Closes #8423: Allow assigning Service to FHRP Group, in addition to Device and VirtualMachine (#19005)

This commit is contained in:
Jason Novinger
2025-04-11 09:27:31 -05:00
committed by GitHub
parent fc0acb020f
commit f96df73093
23 changed files with 537 additions and 140 deletions

View File

@@ -3,7 +3,7 @@ import yaml
from functools import cached_property
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.core.exceptions import ValidationError
from django.core.files.storage import default_storage
from django.core.validators import MaxValueValidator, MinValueValidator
@@ -609,6 +609,12 @@ class Device(
null=True,
help_text=_("GPS coordinate in decimal format (xx.yyyyyy)")
)
services = GenericRelation(
to='ipam.Service',
content_type_field='parent_object_type',
object_id_field='parent_object_id',
related_query_name='device',
)
# Counter fields
console_port_count = CounterCacheField(