#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 [EMAIL PROTECTED]):
Hmm, I see your point, but there is still some fuglyness in the
serializing. What I want to do in this specific case is pass a year, month
and a queryset. It would be really nice if I could just do:
{{{serializers.serialize("json", {'year':year, 'month':month,
'events':events})}}}. This will raise a AttributeError: 'str' object has
no attribute '_meta'. It seems to me that objects that are supported by
the serializer should just be passed through and not blindly attempted to
be read as django models and there should be some recursion or something
to handle when the input parameter has a QuerySet inside it. Serializing
two QuerySets is also a case that the current system doesn't seem to
handle in a straight forward manner.
When reading the code for {{{serializers.serialize()}}} it becomes clear
that it really is only intended to serialize single QuerySets. The name is
slightly misleading for this in my opinion. I don't really know how to
solve this problem in a clean way with the current code.
--
Ticket URL: <http://code.djangoproject.com/ticket/3564#comment:3>
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
-~----------~----~----~----~------~----~------~--~---