17929 Add Scope Mixins to Prefix

This commit is contained in:
Arthur Hanson 2024-11-04 12:36:49 -08:00
parent 5189b1df19
commit 8f8376f0e1
3 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ class IPAMConfig(AppConfig):
# Register denormalized fields # Register denormalized fields
denormalized.register(Prefix, '_site', { denormalized.register(Prefix, '_site', {
'_region': 'region', '_region': 'region',
'_sitegroup': 'group', '_site_group': 'group',
}) })
denormalized.register(Prefix, '_location', { denormalized.register(Prefix, '_location', {
'_site': 'site', '_site': 'site',

View File

@ -154,7 +154,7 @@ class IPRangeType(NetBoxObjectType):
@strawberry_django.type( @strawberry_django.type(
models.Prefix, models.Prefix,
exclude=('scope_type', 'scope_id', '_location', '_region', '_site', '_sitegroup'), exclude=('scope_type', 'scope_id', '_location', '_region', '_site', '_site_group'),
filters=PrefixFilter filters=PrefixFilter
) )
class PrefixType(NetBoxObjectType, BaseIPAddressFamilyType): class PrefixType(NetBoxObjectType, BaseIPAddressFamilyType):

View File

@ -15,7 +15,7 @@ def populate_denormalized_fields(apps, schema_editor):
prefix._site_id = prefix.site_id prefix._site_id = prefix.site_id
# Note: Location cannot be set prior to migration # 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): class Migration(migrations.Migration):