Answer the question
In order to leave comments, you need to log in
Is it possible to create sql query and get 2 queryset?
A question for self-development, let's say I have posts and I must first display all posts with the True flag on the page and then all the posts with the False flag. Now I do it like this:
1) I get all posts from the database
2) a loop going through all posts and displaying only posts with the True flag
3) a loop through all posts outputting with the False flag
Is it possible to immediately get 2 querysets with different flags via SQL query so as not to drive cycles, in general, in some subds, orm?
Well, can someone tell me how to do it right, I have a project on Django + PostreSQL
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question