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

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

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -