Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#13909 closed (invalid)

Info on using "bare" json module in "Serializing Django Objects"

Reported by: JonathanHayward Owned by: nobody
Component: Documentation Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Gabriel Hurley)

http://docs.djangoproject.com/en/dev/topics/serialization/ covers how to serialize certain data, namely QuerySets and other model-based data, but it does not appear to contain or cross-reference how one would use the "bare" json module and json.dumps (not serializers.get_serializer('json')()-created objects) to serialize a basic concoction of one or more strings, numbers, hashes, and lists.

In terms of "information scent", the page is a natural search result for django serialization which people could find if they are looking how to serialize JSON-like data for Ajax use. Ideally that page should cross-reference, or possibly contain, how to do basic serialization to JSON for constructions from strings/numbers/hashes/lists, particularly as what you get from serializers.get_serializer('json')() has an allergic response to being asked to serialize non-iterable data.

Change History (3)

comment:1 by Gabriel Hurley, 13 years ago

Description: modified (diff)
Summary: [Enhancement] Cross-reference to "bare" json module suggested for "Serializing Django Objects"Info on using "bare" json module in "Serializing Django Objects"
Triage Stage: UnreviewedAccepted

A brief explanation and an example would be helpful, since this is a natural place for people to look for this type of information.

comment:2 by Ramiro Morales, 13 years ago

Resolution: invalid
Status: newclosed

This paragraph of the report: Ideally that page should cross-reference, or possibly contain, how to do basic serialization to JSON for constructions from strings/numbers/hashes/lists tells me the OP is asking for information about general Python-JSON serialization.

IMHO (un)fortunately there is a limit in the amount of general no-Django specific information we can put in our docs. That kind of information should be in other places (e.g. the simplejson library docs?).

The fact that one of the uses for this is in AJAX mechanisms (and hence related to the web-centric nature of Django) doesn't change the fact that JSON serialization of arbitrary Python data types is a more broad topic.

I'm closing this ticket for the reason described above.

Last edited 13 years ago by Ramiro Morales (previous) (diff)

comment:3 by Gabriel Hurley, 13 years ago

Upon further review I'm inclined to agree if only because the page is actually titled "Serializing Django objects".

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