netbox/netbox/utilities/htmx.py

14 lines
321 B
Python
Raw Normal View History

2024-02-02 01:58:59 +01:00
__all__ = (
'htmx_partial',
2024-02-02 01:58:59 +01:00
)
PAGE_CONTAINER_ID = 'page-content'
def htmx_partial(request):
2024-02-02 01:58:59 +01:00
"""
Determines whether to render partial (versus complete) HTML content
in response to an HTMX request, based on the target element.
2024-02-02 01:58:59 +01:00
"""
return request.htmx and request.htmx.target != PAGE_CONTAINER_ID