Example:
{{{
class MyModel(models.Model):
name = models.CharField()
for name in ['a', 'b', 'c']:
MyModel.objects.create(name=name)
group1 = MyModel.objects.filter(name='a')
group2 = MyModel.objects.filter(name='b')
group3 = MyModel.objects.filter(name='c')
combined_group = group1.union(group2)
group_and = combined_group & group1
group_or = combined_group | group 3
}}}
In this example, combined_group, group_and and group_or all have the same
SQL. These operators should raise an exception if they can not be applied
after combinator functions.
--
Ticket URL: <https://code.djangoproject.com/ticket/33127>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Hasan Ramezani (added)
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. I'm not sure what behavior would be expected, so we
should raise `TypeError`.
--
Ticket URL: <https://code.djangoproject.com/ticket/33127#comment:1>
* owner: nobody => Hasan Ramezani
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/33127#comment:2>
Comment (by Hasan Ramezani):
[https://github.com/django/django/pull/14890 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/33127#comment:3>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/33127#comment:4>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/33127#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"f997c81472b96a1cf48a1a19a4fe974683455a50" f997c814]:
{{{
#!CommitTicketReference repository=""
revision="f997c81472b96a1cf48a1a19a4fe974683455a50"
Fixed #33127 -- Added error messages on | and & operators with combined
querysets.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33127#comment:6>