mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
treat GFJ and FJ and M2M all the same for type in querystring
This commit is contained in:
parent
d8d874d964
commit
a57d8fe9fd
@ -11,6 +11,7 @@ from django.db.models import Q
|
||||
from django.db.models.fields import FieldDoesNotExist
|
||||
from django.db.models.fields.related import ForeignObjectRel, ManyToManyField
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
# Django REST Framework
|
||||
@ -129,7 +130,7 @@ class FieldLookupBackend(BaseFilterBackend):
|
||||
return to_python_boolean(value, allow_none=True)
|
||||
elif isinstance(field, models.BooleanField):
|
||||
return to_python_boolean(value)
|
||||
elif isinstance(field, (ForeignObjectRel, ManyToManyField)):
|
||||
elif isinstance(field, (ForeignObjectRel, ManyToManyField, GenericForeignKey)):
|
||||
return self.to_python_related(value)
|
||||
else:
|
||||
return field.to_python(value)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user