|
@@ -52,12 +52,17 @@ class Region(NestedGroupModel):
|
|
|
max_length=200,
|
|
max_length=200,
|
|
|
blank=True
|
|
blank=True
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
|
|
+ # Generic relations
|
|
|
vlan_groups = GenericRelation(
|
|
vlan_groups = GenericRelation(
|
|
|
to='ipam.VLANGroup',
|
|
to='ipam.VLANGroup',
|
|
|
content_type_field='scope_type',
|
|
content_type_field='scope_type',
|
|
|
object_id_field='scope_id',
|
|
object_id_field='scope_id',
|
|
|
related_query_name='region'
|
|
related_query_name='region'
|
|
|
)
|
|
)
|
|
|
|
|
+ contacts = GenericRelation(
|
|
|
|
|
+ to='tenancy.ContactAssignment'
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
def get_absolute_url(self):
|
|
def get_absolute_url(self):
|
|
|
return reverse('dcim:region', args=[self.pk])
|
|
return reverse('dcim:region', args=[self.pk])
|
|
@@ -100,12 +105,17 @@ class SiteGroup(NestedGroupModel):
|
|
|
max_length=200,
|
|
max_length=200,
|
|
|
blank=True
|
|
blank=True
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
|
|
+ # Generic relations
|
|
|
vlan_groups = GenericRelation(
|
|
vlan_groups = GenericRelation(
|
|
|
to='ipam.VLANGroup',
|
|
to='ipam.VLANGroup',
|
|
|
content_type_field='scope_type',
|
|
content_type_field='scope_type',
|
|
|
object_id_field='scope_id',
|
|
object_id_field='scope_id',
|
|
|
related_query_name='site_group'
|
|
related_query_name='site_group'
|
|
|
)
|
|
)
|
|
|
|
|
+ contacts = GenericRelation(
|
|
|
|
|
+ to='tenancy.ContactAssignment'
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
def get_absolute_url(self):
|
|
def get_absolute_url(self):
|
|
|
return reverse('dcim:sitegroup', args=[self.pk])
|
|
return reverse('dcim:sitegroup', args=[self.pk])
|
|
@@ -221,12 +231,17 @@ class Site(PrimaryModel):
|
|
|
comments = models.TextField(
|
|
comments = models.TextField(
|
|
|
blank=True
|
|
blank=True
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
|
|
+ # Generic relations
|
|
|
vlan_groups = GenericRelation(
|
|
vlan_groups = GenericRelation(
|
|
|
to='ipam.VLANGroup',
|
|
to='ipam.VLANGroup',
|
|
|
content_type_field='scope_type',
|
|
content_type_field='scope_type',
|
|
|
object_id_field='scope_id',
|
|
object_id_field='scope_id',
|
|
|
related_query_name='site'
|
|
related_query_name='site'
|
|
|
)
|
|
)
|
|
|
|
|
+ contacts = GenericRelation(
|
|
|
|
|
+ to='tenancy.ContactAssignment'
|
|
|
|
|
+ )
|
|
|
images = GenericRelation(
|
|
images = GenericRelation(
|
|
|
to='extras.ImageAttachment'
|
|
to='extras.ImageAttachment'
|
|
|
)
|
|
)
|
|
@@ -291,12 +306,17 @@ class Location(NestedGroupModel):
|
|
|
max_length=200,
|
|
max_length=200,
|
|
|
blank=True
|
|
blank=True
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
|
|
+ # Generic relations
|
|
|
vlan_groups = GenericRelation(
|
|
vlan_groups = GenericRelation(
|
|
|
to='ipam.VLANGroup',
|
|
to='ipam.VLANGroup',
|
|
|
content_type_field='scope_type',
|
|
content_type_field='scope_type',
|
|
|
object_id_field='scope_id',
|
|
object_id_field='scope_id',
|
|
|
related_query_name='location'
|
|
related_query_name='location'
|
|
|
)
|
|
)
|
|
|
|
|
+ contacts = GenericRelation(
|
|
|
|
|
+ to='tenancy.ContactAssignment'
|
|
|
|
|
+ )
|
|
|
images = GenericRelation(
|
|
images = GenericRelation(
|
|
|
to='extras.ImageAttachment'
|
|
to='extras.ImageAttachment'
|
|
|
)
|
|
)
|