Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#14185 closed (fixed)

Possible bad SQL at http://docs.djangoproject.com/en/dev/ref/models/querysets/

Reported by: Trindaz Owned by: lukeplant
Component: Documentation Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Shouldn't

SELECT blog_entry.*, (pub_date > '2006-01-01')
FROM blog_entry;

be

SELECT blog_entry.*, (pub_date > '2006-01-01') AS is_recent
FROM blog_entry;

on http://docs.djangoproject.com/en/dev/ref/models/querysets/

Cheers,
Dave

Change History (3)

comment:1 Changed 5 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to lukeplant
  • Patch needs improvement unset
  • Status changed from new to assigned

The example is perfectly valid SQL, and it is not intended to document exactly what SQL is generated. However, for clarity and consistency with the other examples it would be useful to make the change you suggest.

comment:2 Changed 5 years ago by lukeplant

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

(In [13652]) Fixed #14185 - improved example SQL for 'select' example.

Thanks to Trindaz for the suggestion.

Also fixed some references to 'lede' which is no longer part of the
example Blog model.

comment:3 Changed 5 years ago by lukeplant

(In [13653]) [1.2.X] Fixed #14185 - improved example SQL for 'select' example.

Thanks to Trindaz for the suggestion.

Also fixed some references to 'lede' which is no longer part of the
example Blog model.

Backport of [13652] from trunk.

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