Opened 18 years ago

Closed 18 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: no UI/UX: no

Description

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

Has

class Meta:

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

should be

class Meta:

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

Change History (1)

comment:1 by Karen Tracey, 18 years ago

Resolution: → invalid
Status: new → 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.

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