Ticket #17429: bug_17429.patch
File bug_17429.patch, 1.3 KB (added by , 13 years ago) |
---|
-
django/db/models/sql/compiler.py
309 309 elif not self.query.default_ordering: 310 310 ordering = self.query.order_by 311 311 else: 312 ordering = self.query.order_by or self.query.model._meta.ordering 312 ordering = self.query.order_by or self.query.model._meta.ordering or () 313 313 qn = self.quote_name_unless_alias 314 314 qn2 = self.connection.ops.quote_name 315 315 distinct = self.query.distinct -
tests/regressiontests/queries/tests.py
826 826 1 827 827 ) 828 828 829 def test_ticket17429(self): 830 original_ordering = Tag._meta.ordering 831 try: 832 Tag._meta.ordering = None 833 self.assertQuerysetEqual( 834 Tag.objects.all(), 835 ['<Tag: t1>', '<Tag: t2>', '<Tag: t3>', '<Tag: t4>', '<Tag: t5>'], 836 ) 837 finally: 838 Tag._meta.ordering = original_ordering 829 839 830 840 class Queries2Tests(TestCase): 831 841 def setUp(self):