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:
@@ -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)',
|
||||
|
@@ -8,7 +8,6 @@ from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.validators import ValidationError
|
||||
from django.db import models
|
||||
from django.http import HttpResponse
|
||||
from django.template import Template, Context
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
from rest_framework.utils.encoders import JSONEncoder
|
||||
@@ -32,6 +31,7 @@ class Webhook(models.Model):
|
||||
delete in NetBox. The request will contain a representation of the object, which the remote application can act on.
|
||||
Each Webhook can be limited to firing only on certain actions or certain object types.
|
||||
"""
|
||||
# TODO: Rename obj_type to content_types (see #4711)
|
||||
obj_type = models.ManyToManyField(
|
||||
to=ContentType,
|
||||
related_name='webhooks',
|
||||
|
Reference in New Issue
Block a user