mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
Setup ObjectChangeFilterForm __init__ to add query_param to filter_id
This commit is contained in:
parent
5514df9dee
commit
576abc19e2
@ -128,6 +128,16 @@ class JobFilterForm(SavedFiltersMixin, FilterForm):
|
|||||||
|
|
||||||
|
|
||||||
class ObjectChangeFilterForm(SavedFiltersMixin, FilterForm):
|
class ObjectChangeFilterForm(SavedFiltersMixin, FilterForm):
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
# Limit saved filters to those applicable to the form's model
|
||||||
|
object_type = ObjectType.objects.get_for_model(self.model)
|
||||||
|
self.fields['filter_id'].widget.add_query_params({
|
||||||
|
'object_type_id': object_type.pk,
|
||||||
|
})
|
||||||
|
|
||||||
model = ObjectChange
|
model = ObjectChange
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('q', 'filter_id'),
|
FieldSet('q', 'filter_id'),
|
||||||
|
Loading…
Reference in New Issue
Block a user