Get nth parent in DJANGO -


i have models this:

a->b->c->d 

b parent of a, c parent of b...

i have a object database. best way related d object a object?

to retrieve instance of d instance of a:

d_instance = a_instance.b.c.d 

where a_instance instance of class a.

whether "best way" question; depends on mean "best". performance-wise depends on how data structured.

remember join effected each time entity (or parent) accessed using dot notation shown above.


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -