mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-14 15:52:18 -06:00
* Replace site FK on Prefix with scope GFK * Add denormalized relations * Update prefix filters * Add generic relations for Prefix * Update GraphQL type for Prefix model * Fix tests; misc cleanup * Remove prefix_count from SiteSerializer * Remove site field from PrefixBulkEditForm * Restore scope filters for prefixes * Fix scope population on PrefixForm init * Show scope type * Assign scope during bulk import of prefixes * Correct handling of GenericForeignKey in PrefixForm * Add prefix counts to all scoped objects * Fix migration; linter fix * Add limit_choices_to on scope_type * Clean up cache_related_objects() * Enable bulk editing prefix scope
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
from netbox import denormalized
|
||||
|
||||
|
||||
class IPAMConfig(AppConfig):
|
||||
name = "ipam"
|
||||
@@ -8,6 +10,16 @@ class IPAMConfig(AppConfig):
|
||||
def ready(self):
|
||||
from netbox.models.features import register_models
|
||||
from . import signals, search # noqa: F401
|
||||
from .models import Prefix
|
||||
|
||||
# Register models
|
||||
register_models(*self.get_models())
|
||||
|
||||
# Register denormalized fields
|
||||
denormalized.register(Prefix, '_site', {
|
||||
'_region': 'region',
|
||||
'_sitegroup': 'group',
|
||||
})
|
||||
denormalized.register(Prefix, '_location', {
|
||||
'_site': 'site',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user