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

Closes #15042: Move model registration logic to AppConfigs (#15203)

* Closes #15042: Move model registration logic to AppConfigs

* Refactor register_model() to accept multiple models
This commit is contained in:
Jeremy Stretch
2024-02-21 14:22:13 -05:00
committed by GitHub
parent 7abb2b2ab5
commit 5f159795dd
14 changed files with 99 additions and 69 deletions

View File

@ -16,5 +16,9 @@ class CoreConfig(AppConfig):
name = "core"
def ready(self):
from core.api import schema # noqa
from netbox.models.features import register_models
from . import data_backends, search
from core.api import schema # noqa: E402
# Register models
register_models(*self.get_models())