Closes #722: Enabled custom fields for device types

This commit is contained in:
Jeremy Stretch
2016-12-16 10:54:45 -05:00
parent 712567cabc
commit b56e37ad84
10 changed files with 52 additions and 16 deletions

View File

@@ -521,7 +521,7 @@ class Manufacturer(models.Model):
return "{}?manufacturer={}".format(reverse('dcim:devicetype_list'), self.slug)
class DeviceType(models.Model):
class DeviceType(models.Model, CustomFieldModel):
"""
A DeviceType represents a particular make (Manufacturer) and model of device. It specifies rack height and depth, as
well as high-level functional role(s).
@@ -553,6 +553,7 @@ class DeviceType(models.Model):
choices=SUBDEVICE_ROLE_CHOICES,
help_text="Parent devices house child devices in device bays. Select "
"\"None\" if this device type is neither a parent nor a child.")
custom_field_values = GenericRelation(CustomFieldValue, content_type_field='obj_type', object_id_field='obj_id')
class Meta:
ordering = ['manufacturer', 'model']