mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 11:56:25 -06:00
17929 Add Scope Mixins to Prefix
This commit is contained in:
parent
5189b1df19
commit
8f8376f0e1
@ -18,7 +18,7 @@ class IPAMConfig(AppConfig):
|
||||
# Register denormalized fields
|
||||
denormalized.register(Prefix, '_site', {
|
||||
'_region': 'region',
|
||||
'_sitegroup': 'group',
|
||||
'_site_group': 'group',
|
||||
})
|
||||
denormalized.register(Prefix, '_location', {
|
||||
'_site': 'site',
|
||||
|
@ -154,7 +154,7 @@ class IPRangeType(NetBoxObjectType):
|
||||
|
||||
@strawberry_django.type(
|
||||
models.Prefix,
|
||||
exclude=('scope_type', 'scope_id', '_location', '_region', '_site', '_sitegroup'),
|
||||
exclude=('scope_type', 'scope_id', '_location', '_region', '_site', '_site_group'),
|
||||
filters=PrefixFilter
|
||||
)
|
||||
class PrefixType(NetBoxObjectType, BaseIPAddressFamilyType):
|
||||
|
@ -15,7 +15,7 @@ def populate_denormalized_fields(apps, schema_editor):
|
||||
prefix._site_id = prefix.site_id
|
||||
# Note: Location cannot be set prior to migration
|
||||
|
||||
Prefix.objects.bulk_update(prefixes, ['_region', '_sitegroup', '_site'])
|
||||
Prefix.objects.bulk_update(prefixes, ['_region', '_site_group', '_site'])
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
Loading…
Reference in New Issue
Block a user