Opened 5 years ago

Closed 4 years ago

#17156 closed Cleanup/optimization (fixed)

QuerySet.__contains__ needs documentation

Reported by: guettli 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 5 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by sebastian

  • Cc sebastian.goll@… added

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

  • Resolution set to fixed
  • Status changed from new to closed

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