@Malcolm:

I agree with you that there are some holes in code - it was a quick
hack to solve issue at hand. I did suspect that there should be some
effort to implement this feature and tickets quoted confirm that. It
is too bad that as of now it has not done yet even though tickets
appear to be 2 years old. Is there anything I could to help, please
let me know.

On Mar 19, 7:04 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> On Thu, 2009-03-19 at 05:17 -0700, Vitaly wrote:
> > I wanted json serialize a tree of django model objects: Schedule ->
> > Player -> django.models.User.
> > django.core.serializers.serialize does shallow serialization of
> > QuerySet but I want a deep one. Next, I looked at QuerySet.values()
> > plus simplejson but alas the shallow copy again.
>
> So it's not about "copying" -- taking one Python object and creating a
> similar, but independent one -- at all. You're talking about how far
> down the relation chain we descend when retrieving data.
>
> Bob Thomas has already point out one ticket and there are some others
> opened regarding pulling related models in via a values() call
> (searching for tickets about values() will reveal a bunch of different
> directions and proposals).
>
> Your patch isn't particularly neat (examining the string representation
> of the output of type() to determine a class when isinstance() exists,
> for example). It also looks like it will fail for infinitely recursive
> structures (which exist in practical situations).
>
> Utlimately, though, I think this situation is solved by allowing
> select_related() to work with values() -- ticket #5768 is one reference
> to that. It's not a trivial problem to solve, but we'll fix it one day.
> Multi-valued relations, in particular, require care to make them work
> efficiently.
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to