mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Update relations.py
This commit is contained in:
parent
1d990eaba1
commit
1538f53ef8
|
@ -492,7 +492,7 @@ class ManyRelatedField(Field):
|
|||
if not self.allow_empty and len(data) == 0:
|
||||
self.fail('empty')
|
||||
|
||||
if self.child_relation.use_pk_only_optimization:
|
||||
if isinstance(self.child_relation, PrimaryKeyRelatedField):
|
||||
values = list(self.child_relation.get_queryset().filter(pk__in=data))
|
||||
missing_primary_keys = set(v.pk for v in values) - set(data)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user