mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 21:10:13 +03:00
Merge d470a2c173
into 7b639c0cd0
This commit is contained in:
commit
5dab548681
|
@ -365,7 +365,7 @@ class ManyRelatedField(Field):
|
|||
@property
|
||||
def choices(self):
|
||||
queryset = self.child_relation.queryset
|
||||
iterable = queryset.all() if (hasattr(queryset, 'all')) else queryset
|
||||
iterable = queryset.all() if (hasattr(queryset, 'all')) else queryset or []
|
||||
items_and_representations = [
|
||||
(item, self.child_relation.to_representation(item))
|
||||
for item in iterable
|
||||
|
|
Loading…
Reference in New Issue
Block a user