Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15875 closed Bug (fixed)

F() example in db queries topic guide has an error

Reported by: jblaine Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX:

Description

http://docs.djangoproject.com/en/1.3/topics/db/queries/#filters-can-reference-fields-on-the-model

I'm thinking this is incorrect. The F() object references the pingback count, no?

For example, to find a list of all blog entries that have had more comments than
pingbacks, we construct an F() object to reference the comment count, and use
that F() object in the query:

>>> from django.db.models import F
>>> Entry.objects.filter(n_comments__gt=F('n_pingbacks'))

Attachments (1)

15875.diff (588 bytes) - added by koen.biermans@… 4 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 years ago by Alex

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

Changed 4 years ago by koen.biermans@…

comment:2 Changed 4 years ago by koen.biermans@…

  • Has patch set

comment:3 Changed 4 years ago by jacob

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 4 years ago by timo

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

In [16096]:

Fixed #15875 - typo in F() example; thanks jblaine.

comment:5 Changed 4 years ago by timo

In [16097]:

[1.3.X] Fixed #15875 - typo in F() example; thanks jblaine.

Backport of r16096 from trunk.

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