1210 self._update_outer_tables(table, actualtables, tablealias, outerjoin) |
1210 self._update_outer_tables(table, actualtables, tablealias, outerjoin) |
1211 |
1211 |
1212 def _update_outer_tables(self, table, actualtables, oldalias, newalias): |
1212 def _update_outer_tables(self, table, actualtables, oldalias, newalias): |
1213 actualtables.remove(oldalias) |
1213 actualtables.remove(oldalias) |
1214 actualtables.append(newalias) |
1214 actualtables.append(newalias) |
|
1215 self._state.outer_tables[table] = newalias |
1215 # some tables which have already been used as outer table and replaced |
1216 # some tables which have already been used as outer table and replaced |
1216 # by <oldalias> may not be reused here, though their associated value |
1217 # by <oldalias> may not be reused here, though their associated value |
1217 # in the outer_tables dict has to be updated as well |
1218 # in the outer_tables dict has to be updated as well |
1218 for table, outerexpr in self._state.outer_tables.iteritems(): |
1219 for table, outerexpr in self._state.outer_tables.iteritems(): |
1219 if outerexpr == oldalias: |
1220 if outerexpr == oldalias: |
1220 self._state.outer_tables[table] = newalias |
1221 self._state.outer_tables[table] = newalias |
1221 self._state.outer_tables[table] = newalias |
|
1222 |
1222 |
1223 def _var_table(self, var): |
1223 def _var_table(self, var): |
1224 var.accept(self)#.visit_variable(var) |
1224 var.accept(self)#.visit_variable(var) |
1225 return var._q_sqltable |
1225 return var._q_sqltable |
1226 |
1226 |