Opened 7 years ago

Closed 6 years ago

#17156 closed Cleanup/optimization (fixed)

QuerySet.__contains__ needs documentation

Reported by: Thomas Güttler Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: hv@…, sebastian.goll@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The documentation should explain what happens in this code:

if obj in queryset:

If queryset is huge, the above code can be very slow.

If you want to run the code in the database, you should use this:

if queryset.filter(

Related discussion:

Can someone please provide a patch for the documentation. I am not a native speaker, and won't find the right words.

Change History (4)

comment:1 Changed 7 years ago by Luke Plant

Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Sebastian Goll

Cc: sebastian.goll@… added

comment:4 Changed 6 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In [d823bb790d3b70e19e7f8bc7cfb11f3a1728a799]:

Fixed #17156 -- Added documentation examples for exists()

Thanks mrmagooey for the draft patch.

Note: See TracTickets for help on using tickets.
Back to Top