Added section to docs/db-api.txt about ordering by fields in other tables

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2076 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-01-20 20:23:57 +00:00
parent 2483ed749b
commit 5355ec9992
1 changed files with 5 additions and 0 deletions

View File

@ -273,6 +273,11 @@ so::
polls.get_list(order_by=['?']) polls.get_list(order_by=['?'])
To order by a field in a different table, add the other table's name and a dot,
like so::
choices.get_list(order_by=('polls.pub_date', 'choice'))
There's no way to specify whether ordering should be case sensitive. With There's no way to specify whether ordering should be case sensitive. With
respect to case-sensitivity, Django will order results however your database respect to case-sensitivity, Django will order results however your database
backend normally orders them. backend normally orders them.