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

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -