mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-10 22:02:17 -06:00
14 lines
417 B
Python
14 lines
417 B
Python
from netbox.registry import registry
|
|
|
|
|
|
def register_filterset(filterset_class):
|
|
"""
|
|
Decorator for registering a FilterSet with the application registry.
|
|
|
|
Uses model identifier as key to match search index pattern.
|
|
"""
|
|
model = filterset_class._meta.model
|
|
label = f'{model._meta.app_label}.{model._meta.model_name}'
|
|
registry['filtersets'][label] = filterset_class
|
|
return filterset_class
|