Django

Code

Changeset 9081

Show
Ignore:
Timestamp:
09/21/08 19:31:22 (4 months ago)
Author:
mtredinnick
Message:

Fixed a missing variable initialisation deep in the Query bowels.

Files:

Legend:

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

    r9007 r9081  
    809809        for pos, col in enumerate(self.select): 
    810810            if isinstance(col, (list, tuple)): 
     811                old_alias = col[0] 
    811812                self.select[pos] = (change_map.get(old_alias, old_alias), col[1]) 
    812813            else: 
  • django/trunk/tests/regressiontests/queries/models.py

    r9007 r9081  
    967967True 
    968968 
     969Make sure bump_prefix() (an internal Query method) doesn't (re-)break. 
     970>>> query = Tag.objects.values_list('id').order_by().query 
     971>>> query.bump_prefix() 
     972>>> print query.as_sql()[0] 
     973SELECT U0."id" FROM "queries_tag" U0 
    969974"""} 
    970975