Opened 15 years ago
Closed 15 years ago
#13027 closed (invalid)
serializer won't serialize an empty queryset or an iterator with a None item
Reported by: | adrian_nye | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Ideally, I'd like to be able to serialize any queryset (including an empty one) or a list of django objects including one that is None,
and when I deserialize I should get the same queryset or the same list.
What happens now is you get the error 'NoneType' object has no attribute '_meta'.
If that is not possible, then it should be documented that an empty queryset or an iterator containing a None object cannot be serialized.
Note:
See TracTickets
for help on using tickets.
An empty queryset can be serialized without difficulty. A list that contains a value of None is not. The documentation says that serialize will work on any iterator that yields Django objects. None is not a Django object.