I do not believe that you can do what you ask.
The way you do ORs in django is as follows:
Model.objects.filter(Q(question__startswith='Who') | Q(question__startswith='What'))
so if you really wanted to do this:
Model.objects.filter(Q(language='de') | Q(language='en'))
you will need to put them in the same filter () so that you cannot add another or a sentence in a later call to filter ().
I think the reason you might be trying to do this would be because you are worried about getting into the database again, but the only way to get accurate results is to click the database again.
If you are just worried about creating clean, harsh code, you can put all the filters that are common to both requests at the top, and then the fork, which will be installed later, for example:
shared_qs = Model.objects.filter(active=True)
german_entries = shared_qs.filter(language='de')
german_and_english = shared_qs.filter(Q(language='de') | Q(language='en'))
source
share