Ticket #7057: 7057.diff
File 7057.diff, 1.1 KB (added by , 17 years ago) |
---|
-
django/db/models/sql/query.py
392 392 elif self.default_cols: 393 393 cols = self.get_default_columns(True, with_aliases, col_aliases) 394 394 result.extend(cols) 395 aliases.extend( cols)395 aliases.extend([col.partition(' AS ')[2] or col for col in cols]) 396 396 for table, col in self.related_select_cols: 397 397 r = '%s.%s' % (qn(table), qn(col)) 398 398 if with_aliases and col in col_aliases: … … 434 434 c_alias = 'Col%d' % len(col_aliases) 435 435 result.append('%s.%s AS %s' % (qn(alias), 436 436 qn2(field.column), c_aliase)) 437 col_aliases.add(c_alias) 437 438 else: 438 439 result.append('%s.%s' % (qn(alias), qn2(field.column))) 440 if with_aliases: 441 col_aliases.add(field.column) 439 442 else: 440 443 result.append((alias, field.column)) 441 444 return result