Serialization doc: usage of get_serializer()
At end of document http://www.djangoproject.com/documentation/serialization/
there is example:
json_serializer = serializers.get_serializer("json")
json_serializer.serialize(queryset, ensure_ascii=False, stream=response)
serializers.get_serializer() returns a class object, not actual serializer instance.
The call to json_serializer.serialize fails with:
TypeError: unbound method serialize() must be called with Serializer instance as first argument (got QuerySet instance instead)
Change History
(5)
Has patch: |
set
|
Summary: |
Serialization doc: usage of get_serializer() → [patch] Serialization doc: usage of get_serializer()
|
Triage Stage: |
Unreviewed → Accepted
|
Summary: |
[patch] Serialization doc: usage of get_serializer() → Serialization doc: usage of get_serializer()
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Patch for serialization documentation error