Closed mitar closed 12 years ago
It seems the default is required=False
, but required=True
means that list should not be empty. This probably means that null
should behave like it does, only default for null
should be True
? To match that of MongoEngine? The problem is that default of TastyPie is False
.
Maybe also an error message could be improved for lists?
Current example:
The document has an empty attribute 'comments' and does not allow a null value.
Better maybe:
The document has an empty list attribute 'comments' and does not allow a null value, empty list.
Or maybe just an error message and documentation change should be enough? Just to warn about this situation.
Not it should set null
automatically based on required
. If MongoEngine field is required, then setting field to []
fails. If not required, it can be []
.
EmbeddedListField should probably allow empty list to be stored even with
null=False
?