Django

Code

Changeset 7490

Show
Ignore:
Timestamp:
04/27/08 21:27:19 (2 months ago)
Author:
mtredinnick
Message:

Fixed #7098 -- Old-style related-model order_by() syntax was being incorrectly
marked as erroneous. It's just more dangerous and risky, not forbidden. This
commit restores backwards compatibility there.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/models/sql/constants.py

    r7477 r7490  
    2929SINGLE = 'single' 
    3030 
    31 ORDER_PATTERN = re.compile(r'\?|[-+]?\w+$') 
     31ORDER_PATTERN = re.compile(r'\?|[-+]?[.\w]+$') 
    3232ORDER_DIR = { 
    3333    'ASC': ('ASC', 'DESC'), 
  • django/trunk/tests/regressiontests/queries/models.py

    r7477 r7490  
    655655>>> s = qs.query.as_sql()   # test passes if this doesn't raise an exception. 
    656656 
     657Bug #7098 -- Make sure semi-deprecated ordering by related models syntax still 
     658works. 
     659>>> Item.objects.values('note__note').order_by('queries_note.note', 'id') 
     660[{'note__note': u'n2'}, {'note__note': u'n3'}, {'note__note': u'n3'}, {'note__note': u'n3'}] 
    657661"""} 
    658662