diff options
| author | Julien Phalip <jphalip@gmail.com> | 2012-01-03 09:06:19 +0000 |
|---|---|---|
| committer | Julien Phalip <jphalip@gmail.com> | 2012-01-03 09:06:19 +0000 |
| commit | c93933441e77cefbcb354196bda9a29b7e75df18 (patch) | |
| tree | 7e9c28aa73252058ad50d1a8f875aa965b72c9cc /django/db/models/sql | |
| parent | 31b1cbc623c246570e7301c0334df938d840638f (diff) | |
Fixed #17429 -- Ensured that `Meta.ordering=None` works the same if it were an empty list. Thanks to self[at]dicos[dot]ru for the report and to bigkevmcd for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/compiler.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index b6047febae..72948f9cd7 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -347,7 +347,9 @@ class SQLCompiler(object): elif not self.query.default_ordering: ordering = self.query.order_by else: - ordering = self.query.order_by or self.query.model._meta.ordering + ordering = (self.query.order_by + or self.query.model._meta.ordering + or []) qn = self.quote_name_unless_alias qn2 = self.connection.ops.quote_name distinct = self.query.distinct |
