#33698: QuerySet == operator is not implemented.
-------------------------------------+-------------------------------------
Reporter: Mohammad Ali | Owner: nobody
Mehdizadeh |
Type: New feature | Status: closed
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* status: new => closed
* type: Bug => New feature
* resolution: => wontfix
Comment:
Thanks for this ticket, however as far as I'm aware it's not feasible to
compare two queryset in a performant way (see also
[https://groups.google.com/g/django-developers/c/M_x4BbNta24/m/c5SZD-
uIAQAJ Adam's comment]). This should take into account all
[https://github.com/django/django/blob/34e2148fc725e7200050f74130d7523e3cd8507a/django/db/models/query.py#L291-L304
advanced options] (e.g. used expressions, prefetching, chosen fields,
etc.) and be preceded by an implementation of `==` operator for the
`Query` class which is even
[https://github.com/django/django/blob/34e2148fc725e7200050f74130d7523e3cd8507a/django/db/models/sql/query.py#L161-L228
more complicated]. Comparing the results is not an option because two
completely different queryset can return the same results.
IMO it's not worth the maintenance burden. You can always implement your
own hook if comparing results suits you.
--
Ticket URL: <https://code.djangoproject.com/ticket/33698#comment:1>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070180b67c8823-9f97f8f9-d41c-4538-87a4-e7b0a5d18dea-000000%40eu-central-1.amazonses.com.