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

Closes #9623: Implement saved filters (#10801)

* Initial work on saved filters

* Return only enabled/shared filters

* Add tests

* Clean up filtering of usable SavedFilters
This commit is contained in:
Jeremy Stretch
2022-11-02 12:27:53 -04:00
committed by GitHub
parent ea61a540cd
commit 484efdaf75
37 changed files with 821 additions and 138 deletions

View File

@@ -12,6 +12,7 @@ __all__ = (
'CustomFieldCSVForm',
'CustomLinkCSVForm',
'ExportTemplateCSVForm',
'SavedFilterCSVForm',
'TagCSVForm',
'WebhookCSVForm',
)
@@ -81,6 +82,19 @@ class ExportTemplateCSVForm(CSVModelForm):
)
class SavedFilterCSVForm(CSVModelForm):
content_types = CSVMultipleContentTypeField(
queryset=ContentType.objects.all(),
help_text="One or more assigned object types"
)
class Meta:
model = SavedFilter
fields = (
'name', 'content_types', 'description', 'weight', 'enabled', 'shared', 'parameters',
)
class WebhookCSVForm(CSVModelForm):
content_types = CSVMultipleContentTypeField(
queryset=ContentType.objects.all(),