1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #1687: Enabled custom fields for services

This commit is contained in:
Jeremy Stretch
2018-06-21 16:17:18 -04:00
parent 7819d9c112
commit b945dec41b
6 changed files with 31 additions and 17 deletions

View File

@@ -835,7 +835,7 @@ class VLAN(CreatedUpdatedModel, CustomFieldModel):
@python_2_unicode_compatible
class Service(CreatedUpdatedModel):
class Service(CreatedUpdatedModel, CustomFieldModel):
"""
A Service represents a layer-four service (e.g. HTTP or SSH) running on a Device or VirtualMachine. A Service may
optionally be tied to one or more specific IPAddresses belonging to its parent.
@@ -875,6 +875,11 @@ class Service(CreatedUpdatedModel):
max_length=100,
blank=True
)
custom_field_values = GenericRelation(
to='extras.CustomFieldValue',
content_type_field='obj_type',
object_id_field='obj_id'
)
serializer = 'ipam.api.serializers.ServiceSerializer'