1
0
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:
Jeremy Stretch
2020-10-14 15:23:23 -04:00
parent defade84e4
commit 143f3cc27c
12 changed files with 37 additions and 32 deletions

View File

@ -50,11 +50,11 @@ class CustomFieldManager(models.Manager):
Return all CustomFields assigned to the given model.
"""
content_type = ContentType.objects.get_for_model(model._meta.concrete_model)
return self.get_queryset().filter(obj_type=content_type)
return self.get_queryset().filter(content_types=content_type)
class CustomField(models.Model):
obj_type = models.ManyToManyField(
content_types = models.ManyToManyField(
to=ContentType,
related_name='custom_fields',
verbose_name='Object(s)',