dabo Commit
Revision 4884
Date: 2008-12-22 15:00:00 -0800 (Mon, 22 Dec 2008)
Author: Paul
Trac: http://trac.dabodev.com/changeset/4884
Changed:
U trunk/dabo/db/dBackend.py
Log:
addJoin() was adding join conditions in backwards order:
addFrom("customers")
addJoin("invoices", "invoices.customer_id = customers.id")
addJoin("invoice_lines", "invoice_lines.invoice_id = invoices.id")
would result in:
from customers
inner join invoice_lines on invoice_lines.invoice_id = invoices.id
inner join invoices on invoices.customer_id = customers.id
which would result in an error in the sql.
Fixed.
Diff:
Modified: trunk/dabo/db/dBackend.py
===================================================================
--- trunk/dabo/db/dBackend.py 2008-12-21 22:48:46 UTC (rev 4883)
+++ trunk/dabo/db/dBackend.py 2008-12-22 23:00:00 UTC (rev 4884)
@@ -288,7 +288,7 @@
joinType = self.formatJoinType(joinType)
indent = len("select ") * " "
clause = "%(joinType)s join %(tbl)s on %(joinCondition)s" %
locals()
- return self.addWithSep(clause, exp, sep="\n%s" % indent)
+ return self.addWithSep(exp, clause, sep="\n%s" % indent)
def addWhere(self, clause, exp, comp="and", autoQuote=True):
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]