sector119 wrote: > > Hi! > > Is it possible to easily add tables to FROM clause, now I use > following code to append additional table names but it look like a > hack.. > > at PGCompiler.visit_update() I see self.stack.append({'from': set > ([update_stmt.table])}) where and how it's used, may be using this I > can append some elements to the FROM ? > > def visit_update(self, update_stmt): > text = super(PGCompiler, self).visit_update(update_stmt) > if 'postgresql_from' in update_stmt.kwargs: > text = self._append_from(text, update_stmt) > return text > > def _append_from(self, text, stmt): > return text.replace(' WHERE', ' FROM ' + string.join([table.name for > table in stmt.kwargs['postgresql_from']], ', ') + ' WHERE')
we don't have FROM support in UPDATE. You want to use the compiler extension to create this construct yourself: http://www.sqlalchemy.org/docs/06/reference/ext/compiler.html > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---