#25982: Djago ORM. Filter using multi-valued queryset
-------------------------------------+-------------------------------------
Reporter: FreddieFruitSticks | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.8
(models, ORM) | Keywords: mutli-value,
Severity: Normal | valuequeryset
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
As I understand it, and from the error I received, trying to filter based
on a multi-valued queryset cant be done (the error I received was
something like "cant filter using multi-valued querysets"). It is possible
that one may wish to filter based on a pair of values. Commutativity of
the tuples should be considered. Eg Filter the following:
Object.objects.values_list("v1","v2").filter(AnotherObject.objects.values_list("v1","v2"))
Eg,
[(1,2),(5,7),(3,8),(9,3)].filter ([(1,2),(3,9)]) = [(5,7),(3,8),(9,3)]
here (9,3) == (3,9) is false. Non-commutative
For commutative comparison we have Eg,
[(1,2),(5,7),(3,8),(9,3)].filter ([(1,2),(3,9)]) = [(5,7),(3,8)]
here (9,3) == (3,9) is true.
The non-commutative case was necessary in an example I had. I hacked it
where I created lists and compared using lists. However this requires a db
evaluation.
--
Ticket URL: <https://code.djangoproject.com/ticket/25982>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/061.bdcda91605854a273ddb16122edd7030%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.