#3564: flexible JSON serializing mechanism
-----------------------------------+----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: jacob
Status: new | Component: Serialization
Version: SVN | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-----------------------------------+----------------------------------------
Comment (by mtredinnick):
The reason core.serialization only worries about !QuerySets is because you
can already serialize other stuff directly using simplejson. Just import
{{{utils.simplejson}}} and go to work there. Normal Python structures are
already supported; the only hard bit was the results of queries.
As far as serializing multiple queries goes, since the result of a
{{{serialize()}}} is just a list of dictionaries, you can serialise things
one at a time and concatenate the lists without any real effort. It's not
really worth adding extra syntax for that (and one day, unions of
!QuerySet instances will work properly, so it will be possible to do that
as well).
I think the only thing we can do here is add a bit more to the
documentation. We don't want to duplicate the stuff that simplejson
already does so well -- only add the necessary bits for Django-specifics.
I agree, it's not immediately obvious how to do some of the above, but you
haven't described anything that isn't already possible in only a line or
two of code, which is about as minimal as it gets.
--
Ticket URL: <http://code.djangoproject.com/ticket/3564#comment:4>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---