[Django] #32518: Document that QuerySet.contains() should not be overused.

46 views
Skip to first unread message

Django

unread,
Mar 6, 2021, 3:26:52 PM3/6/21
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
------------------------------------------------+------------------------
Reporter: Mariusz Felisiak | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Adjust
[https://docs.djangoproject.com/en/dev/topics/db/optimization/#don-t
-overuse-count-and-exists "Don’t overuse count() and exists()"] section in
docs to mention `QuerySet.contains()`, see
[https://github.com/django/django/pull/13038#discussion_r588131243
comment].

Follow up to #24141.

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

Django

unread,
Mar 11, 2021, 3:02:21 AM3/11/21
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
--------------------------------------+------------------------------------

Reporter: Mariusz Felisiak | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:1>

Django

unread,
Mar 20, 2021, 12:38:51 AM3/20/21
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
--------------------------------------+------------------------------------

Reporter: Mariusz Felisiak | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by AdamDonna):

I've had a go at addressing this change. I suspect this will need some
refinement. The PR is at https://github.com/django/django/pull/14161

--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:2>

Django

unread,
Mar 22, 2021, 3:25:06 AM3/22/21
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: AdamDonna
Type: | Status: assigned
Cleanup/optimization |
Component: Documentation | Version: 4.0

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: nobody => AdamDonna
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:3>

Django

unread,
Sep 30, 2021, 2:42:56 PM9/30/21
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: AdamDonna
Type: | Status: assigned
Cleanup/optimization |
Component: Documentation | Version: 4.0

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Pradhvan Bisht ):

SInce the PR [https://github.com/django/django/pull/14161] is closed, I
think Adam is not working on it.

I would be happy to take this up since `tim-mccurrach` has left quite a
detailed note on the PR and it would be easy for me to pick up the
recommendation and add it in a separate PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:4>

Django

unread,
Sep 30, 2021, 2:45:06 PM9/30/21
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Pradhvan
Type: | Bisht
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 4.0

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Pradhvan Bisht ):

* owner: AdamDonna => Pradhvan Bisht


--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:5>

Django

unread,
Dec 7, 2021, 1:56:55 AM12/7/21
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
--------------------------------------+------------------------------------
Reporter: Mariusz Felisiak | Owner: (none)

Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: Pradhvan Bisht => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:6>

Django

unread,
Jan 25, 2022, 8:26:38 PM1/25/22
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: John
Type: | Hollingsworth
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 4.0

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by John Hollingsworth):

* owner: (none) => John Hollingsworth


* status: new => assigned


Comment:

I'll pick up this ticket where the previous PR left off

--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:7>

Django

unread,
Feb 2, 2022, 3:16:41 PM2/2/22
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: John
Type: | Hollingsworth
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 4.0

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by John Hollingsworth):

* needs_better_patch: 1 => 0


Comment:

PR here: https://github.com/django/django/pull/15391

--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:8>

Django

unread,
Feb 3, 2022, 1:26:54 AM2/3/22
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: John
Type: | Hollingsworth
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:9>

Django

unread,
Feb 8, 2022, 2:33:19 AM2/8/22
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: John
Type: | Hollingsworth
Cleanup/optimization | Status: closed
Component: Documentation | Version: 4.0
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"d70b4bea18c96e518ce14dca96085e9265e8ebb6" d70b4be]:
{{{
#!CommitTicketReference repository=""
revision="d70b4bea18c96e518ce14dca96085e9265e8ebb6"
Fixed #32518 -- Doc'd that QuerySet.contains() should not be overused.

Thanks Tim McCurrach for the idea.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:10>

Django

unread,
Feb 8, 2022, 2:33:54 AM2/8/22
to django-...@googlegroups.com
#32518: Document that QuerySet.contains() should not be overused.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: John
Type: | Hollingsworth
Cleanup/optimization | Status: closed
Component: Documentation | Version: 4.0

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"8c407ee7f392ac44e9669658a473d6c486c388b3" 8c407ee7]:
{{{
#!CommitTicketReference repository=""
revision="8c407ee7f392ac44e9669658a473d6c486c388b3"
[4.0.x] Fixed #32518 -- Doc'd that QuerySet.contains() should not be
overused.

Thanks Tim McCurrach for the idea.

Backport of d70b4bea18c96e518ce14dca96085e9265e8ebb6 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32518#comment:11>

Reply all
Reply to author
Forward
0 new messages