diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-03-11 05:21:50 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-03-11 05:21:50 +0000 |
| commit | 619576002d538094dde7293d970bc4698ecdbef5 (patch) | |
| tree | 6f995d548b3bfc9eb921399ab4ee76958d612f0a /docs/db-api.txt | |
| parent | 62bdb6eae8e62e7390f26daa261f75e5cca3b8e7 (diff) | |
queyrset-refactor: Added error reporting if somebody tries to order by a multi-valued field.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7220 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/db-api.txt')
| -rw-r--r-- | docs/db-api.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/db-api.txt b/docs/db-api.txt index 74adc10457..3cab6574ea 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -541,6 +541,13 @@ primary key if there is no ``Meta.ordering`` specified. For example:: ...since the ``Blog`` model has no default ordering specified. +You can only order by model fields that have a single value attached to them +for each instance of the model. For example, non-relations, ``ForeignKey`` and +``OneToOneField`` fields. Explicitly, you can't order by a ``ManyToManyField`` +or a reverse ``ForeignKey`` relation. There's no naturally correct ordering +for many-valued fields and a lot of the alternatives are not psosible to +express in SQL very efficiently. + **New in Django development version:** If you don't want any ordering to be applied to a query, not even the default ordering, call ``order_by()`` with no parameters. |
