1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Apply some quick fixes and add comments

This commit is contained in:
Daniel Sheppard
2024-02-07 13:48:32 -06:00
committed by GitHub
parent 664a0eba6d
commit cc423f5071
2 changed files with 4 additions and 2 deletions

View File

@ -160,9 +160,10 @@ class ObjectListView(BaseMultiObjectView, ActionsMixin, TableMixin):
# Render the objects table # Render the objects table
table = self.get_table(self.queryset, request, has_bulk_actions) table = self.get_table(self.queryset, request, has_bulk_actions)
filterset_form = self.filterset_form(request.GET, label_suffix='') if self.filterset_form else None # Check for filterset_form on this view, if a form exists, apply to context and table, otherwise set to None
filterset_form = None
if hasattr(self, 'filterset_form'): if hasattr(self, 'filterset_form'):
filterset_form = self.filterset_form(request.GET, label_suffix='')
table.filterset_form = filterset_form table.filterset_form = filterset_form
# If this is an HTMX request, return only the rendered table HTML # If this is an HTMX request, return only the rendered table HTML

View File

@ -7,6 +7,7 @@ __all__ = (
'render_custom_fields', 'render_custom_fields',
'render_errors', 'render_errors',
'render_field', 'render_field',
'render_filter_field',
'render_form', 'render_form',
'widget_type', 'widget_type',
) )