mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Respect blank=True on relational fields. Fixes #537
This commit is contained in:
parent
e429f702e0
commit
4bb504732d
|
@ -430,7 +430,7 @@ class ModelSerializer(Serializer):
|
|||
# TODO: filter queryset using:
|
||||
# .using(db).complex_filter(self.rel.limit_choices_to)
|
||||
kwargs = {
|
||||
'null': model_field.null,
|
||||
'null': model_field.null or model_field.blank,
|
||||
'queryset': model_field.rel.to._default_manager
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user