6
Short answer: No. The extra
method doesn’t expect querysets to be passed in.
If you think about it a bit, it makes sense. Querysets are an abstraction used to represent the results of a fetch operation on the database and extra
is a convenient way of attaching custom fields from the database to a queryset. Unless you change the fundamental nature of extra
to mean “custom filtering with another queryset” this will not work.
2
I may understand your question in two ways.
-
You can specify multiple variables
in your filter parameters, for
example :q = Something.objects.filter(x=y, w=z)
-
You want to make what is called a “join” in SQL. This can be done via the aggregation system of Django, see the official Django Official Documentation.
- [Django]-Mock a model method in Django
- [Django]-Using Google App Engine Queues service with Django
- [Django]-Using mongoengine with models.ImageField
- [Django]-Json.parse gives Uncaught SyntaxError: Unexpected Token (Django json serialized queryset)
Source:stackexchange.com