Re: [Django] #32068: Raise a descriptive error on get() with filters operation following QuerySet.union(), intersection(), and difference(). (was: QuerySet.difference() results in QuerySet.get(**kwargs) ignoring kwargs.)

6 views
Skip to first unread message

Django

unread,
Oct 3, 2020, 3:08:08 PM10/3/20
to django-...@googlegroups.com
#32068: Raise a descriptive error on get() with filters operation following
QuerySet.union(), intersection(), and difference().
-------------------------------------+-------------------------------------
Reporter: Timo Ludwig | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: queryset, | Triage Stage: Accepted
difference |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* cc: Hasan Ramezani (added)
* type: Bug => Cleanup/optimization
* easy: 0 => 1
* stage: Unreviewed => Accepted


Comment:

`get()` with filters is unsupported, see
[https://docs.djangoproject.com/en/stable/ref/models/querysets/#union
documentation]:

> In addition, only LIMIT, OFFSET, COUNT(*), ORDER BY, and specifying
columns (i.e. slicing, count(), order_by(), and values()/values_list())
are allowed on the resulting QuerySet.

but I agree that we should raise a descriptive error for `get(...)` (see
related #27995, #31148).

--
Ticket URL: <https://code.djangoproject.com/ticket/32068#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages