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