Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11235 closed (fixed)

minor error in queryset documentation

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

Description

There is a minor error in the second example of using the 'select' parameter to the 'extra' queryset method at
http://docs.djangoproject.com/en/dev/ref/models/querysets/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none

The second example's "resulting SQL" is missing "AS entry_count" for its subquery.

It should read as follows:

SELECT blog_blog.*, (SELECT COUNT(*) FROM blog_entry WHERE blog_entry.blog_id = blog_blog.id) AS entry_count
FROM blog_blog;

Currently "AS entry_count" is missing. (The example is intended to create an entry_count attribute).

Attachments (1)

11235.diff (604 bytes) - added by timo 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by timo

comment:1 Changed 5 years ago by timo

  • Component changed from Uncategorized to Documentation
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin
  • Version changed from 1.0 to SVN

comment:2 Changed 5 years ago by russellm

(In[ 11239]) Fixed #11235 -- Added a missing clause from some sample SQL in the queryset docs.

comment:3 Changed 5 years ago by russellm

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

comment:4 Changed 5 years ago by russellm

(In [11245]) [1.0.X] Fixed #11235 -- Added a missing clause from some sample SQL in the queryset docs.

Merge of r11239 from trunk.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.