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

Add UI views for custom fields

This commit is contained in:
jeremystretch
2021-06-22 16:28:06 -04:00
parent e59d88bbe9
commit b017927c69
12 changed files with 384 additions and 73 deletions

View File

@ -109,12 +109,12 @@ class ModelTestCase(TestCase):
# Handle ManyToManyFields
if value and type(field) in (ManyToManyField, TaggableManager):
if field.related_model is ContentType:
if field.related_model is ContentType and api:
model_dict[key] = sorted([f'{ct.app_label}.{ct.model}' for ct in value])
else:
model_dict[key] = sorted([obj.pk for obj in value])
if api:
elif api:
# Replace ContentType numeric IDs with <app_label>.<model>
if type(getattr(instance, key)) is ContentType: