mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 19:08:38 -06:00
code lint, move __init__ to end of class
This commit is contained in:
parent
576abc19e2
commit
621cda3eda
@ -128,16 +128,6 @@ 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'),
|
||||||
@ -170,6 +160,15 @@ class ObjectChangeFilterForm(SavedFiltersMixin, FilterForm):
|
|||||||
label=_('Object Type'),
|
label=_('Object Type'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
class ConfigRevisionFilterForm(SavedFiltersMixin, FilterForm):
|
class ConfigRevisionFilterForm(SavedFiltersMixin, FilterForm):
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
|
Loading…
Reference in New Issue
Block a user