Respect blank=True on relational fields. Fixes #537

This commit is contained in:
Tom Christie 2013-01-07 21:08:55 +00:00
parent e429f702e0
commit 4bb504732d

View File

@ -430,7 +430,7 @@ class ModelSerializer(Serializer):
# TODO: filter queryset using: # TODO: filter queryset using:
# .using(db).complex_filter(self.rel.limit_choices_to) # .using(db).complex_filter(self.rel.limit_choices_to)
kwargs = { kwargs = {
'null': model_field.null, 'null': model_field.null or model_field.blank,
'queryset': model_field.rel.to._default_manager 'queryset': model_field.rel.to._default_manager
} }