mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Rename content_type_identifier() and content_type_name()
This commit is contained in:
@ -5,7 +5,7 @@ from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
|
||||
from django.db.models import Q
|
||||
|
||||
from utilities.choices import unpack_grouped_choices
|
||||
from utilities.utils import content_type_identifier
|
||||
from utilities.utils import object_type_identifier
|
||||
|
||||
__all__ = (
|
||||
'CSVChoiceField',
|
||||
@ -86,7 +86,7 @@ class CSVContentTypeField(CSVModelChoiceField):
|
||||
STATIC_CHOICES = True
|
||||
|
||||
def prepare_value(self, value):
|
||||
return content_type_identifier(value)
|
||||
return object_type_identifier(value)
|
||||
|
||||
def to_python(self, value):
|
||||
if not value:
|
||||
@ -115,4 +115,4 @@ class CSVMultipleContentTypeField(forms.ModelMultipleChoiceField):
|
||||
app_label, model = name.split('.')
|
||||
ct_filter |= Q(app_label=app_label, model=model)
|
||||
return list(ContentType.objects.filter(ct_filter).values_list('pk', flat=True))
|
||||
return content_type_identifier(value)
|
||||
return object_type_identifier(value)
|
||||
|
Reference in New Issue
Block a user