0

I am working on an app in django and i am wondering if there is a method to chain multiple objects into 1 parent.

For example, I have -query_1-, -query_2-, and I would like to put the objects that those queries return into one -parent_object- to pass to the template, which I can access on the template side like {{ parent_object.query_1.field }}, is this possible or is there a way to achieve a similar effect ?

0

1 Answer 1

2
from itertools import chain
chained_qs = chain(qs1, qs2)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.