mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Initial work on saved filters * Return only enabled/shared filters * Add tests * Clean up filtering of usable SavedFilters
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user