Opened 6 years ago

Closed 6 years ago

#26310 closed Cleanup/optimization (fixed)

Document that a query's default ordering is unspecified

Reported by: Wim Feijen Owned by: nobody
Component: Documentation Version: 1.9
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: no

Description

https://docs.djangoproject.com/en/1.9/ref/models/options/#ordering

Mistakenly, I was thinking that if no ordering was given on a Model's Meta, ordering is by "-id". I was foolishly mistaken. My proposal is to add to the documentation:

"If no ordering is given, results are returned from the database as is. Ordering might be anything, semi-randomly."

Change History (3)

comment:1 Changed 6 years ago by Tim Graham

Has patch: set
Summary: add to documentation that a Model's default ordering is semi-randomlyDocument that a query's default ordering is unspecified
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 Changed 6 years ago by Simon Charette

Triage Stage: AcceptedReady for checkin

comment:3 Changed 6 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In c0181f2c:

Fixed #26310 -- Documented that a queryset ordering must be specified to ensure ordered results.

Thanks Simon Charette for review.

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