Code

Opened 5 years ago

Closed 5 years ago

#10748 closed (invalid)

Incorrect example code for ordering in class Meta:

Reported by: craig@… Owned by: nobody
Component: Documentation Version:
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

http://www.djangoproject.com/documentation/models/ordering/

Has

class Meta:

ordering = ('-pub_date', 'headline')

should be

class Meta:

ordering = ['-pub_date', 'headline']

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

No, ordering (and most/all such settings) can be a tuple: http://docs.djangoproject.com/en/dev/ref/models/options/#ordering. There's nothing wrong with the example as it is.

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.