On Wed, Mar 30, 2011 at 4:08 PM, Russell Keith-Magee <russ...@keith-magee.com> wrote: > On Fri, Mar 25, 2011 at 6:03 PM, Vivek Narayanan <m...@vivekn.co.cc> wrote: >>> When you start dealing with foreign keys and m2m, you have an >>> additional set of assumptions -- >>> >>> * How far should I traverse relations? >> >> The user can specify a limit to the levels of nesting through >> variable ``max_nesting_depth``. > > A simple "nesting depth" approach won't work. You really need to > handle this on a per-model basis; Mode > > It might be possible to automate some of this with a simple nesting > depth definition, but there will always be a need to define the exact > rollout of a tree of serialization options. > > This is also a case where being explicit makes your life easier. If > you stop looking at "depth" as a single number specified at the top of > the tree, it becomes a lot easier to handle recursive or
Damn... pressed send before I finished editing my thoughts here. A simple "nesting depth" approach won't work. You really need to be able to handle this on a per-model basis. It might be possible to automate some of this with a simple nesting depth definition, but there will always be a need to define the exact rollout of a tree of serialization options. This is also a case where being explicit makes your life easier. Resolving loops and cycles on a tree of arbitrary depth is hard; resolving loops and cycles independently on each level of a serialization structure is much easier. Yours, Russ Magee %-) -- 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.