Ticket #8375: custom_alias_for_extra_tables_query.patch
File custom_alias_for_extra_tables_query.patch, 1.2 KB (added by , 16 years ago) |
---|
-
django/db/models/sql/query.py
540 540 result.append('%s%s%s' % (connector, qn(name), alias_str)) 541 541 first = False 542 542 for t in self.extra_tables: 543 alias, unused = self.table_alias(t) 544 if alias not in self.alias_map: 543 name_alias_list = t.split() 544 if len(name_alias_list) > 1: 545 table_name = name_alias_list[0] 546 alias = name_alias_list[1] 545 547 connector = not first and ', ' or '' 546 result.append('%s%s ' % (connector, qn(alias)))548 result.append('%s%s %s' % (connector, qn(table_name), qn(alias))) 547 549 first = False 550 else: 551 alias, unused = self.table_alias(t) 552 if alias not in self.alias_map: 553 connector = not first and ', ' or '' 554 result.append('%s%s' % (connector, qn(alias))) 555 first = False 548 556 return result, [] 549 557 550 558 def get_grouping(self):