Opened 5 years ago

Closed 5 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: UI/UX:

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.

Change History (1)

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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.

Note: See TracTickets for help on using tickets.
Back to Top