mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
#4711: Rename CustomField.obj_type to content_types
This commit is contained in:
@ -24,7 +24,7 @@ class CustomFieldDefaultValues:
|
||||
|
||||
# Retrieve the CustomFields for the parent model
|
||||
content_type = ContentType.objects.get_for_model(self.model)
|
||||
fields = CustomField.objects.filter(obj_type=content_type)
|
||||
fields = CustomField.objects.filter(content_types=content_type)
|
||||
|
||||
# Populate the default value for each CustomField
|
||||
value = {}
|
||||
@ -52,7 +52,7 @@ class CustomFieldsDataField(Field):
|
||||
"""
|
||||
if not hasattr(self, '_custom_fields'):
|
||||
content_type = ContentType.objects.get_for_model(self.parent.Meta.model)
|
||||
self._custom_fields = CustomField.objects.filter(obj_type=content_type)
|
||||
self._custom_fields = CustomField.objects.filter(content_types=content_type)
|
||||
return self._custom_fields
|
||||
|
||||
def to_representation(self, obj):
|
||||
@ -132,7 +132,7 @@ class CustomFieldModelSerializer(ValidatedModelSerializer):
|
||||
|
||||
# Retrieve the set of CustomFields which apply to this type of object
|
||||
content_type = ContentType.objects.get_for_model(self.Meta.model)
|
||||
fields = CustomField.objects.filter(obj_type=content_type)
|
||||
fields = CustomField.objects.filter(content_types=content_type)
|
||||
|
||||
# Populate CustomFieldValues for each instance from database
|
||||
if type(self.instance) in (list, tuple):
|
||||
|
Reference in New Issue
Block a user