On Thu, Sep 5, 2013 at 10:22 AM, James <jclas...@gmail.com> wrote:
> I started writing a new model for a client's website. The easiest analogy I
> can make is something like a menu, so I wrote just that (start simple, then
> add the hard stuff).


the main aspect to choose between "just a parent link" (Adjacency
List) and a full tree library (typically nested sets or materialized
path) is the frequency of full (sub) hierarchy requests.

if in most cases you have a given node and just need to get all the
direct children, then the simplest solution works great.

if, on the other hand, you have to get a whole subbranch at
indeterminate depth, then use something else.

I guess that most pages will have to display the whole menu tree, so
using nested sets seems better since it would add just a single query.
 But if it is the _whole_ tree, then you could just as easily read the
whole table and unravel the hierarchy in python.  Even better, if the
menu doesn't change so often, you should store the rendered structure
in some cache and don't care about the base structure....

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to