I added the following to the test: "and not insert.parameters.has_key(c.key)"
Not fully tested but it does work for my example now.
Here's the new routine with the one addtional line.
def visit_insert(self, insert):
"""inserts are required to have the primary keys be explicitly
present.
mapper will by default not put them in the insert statement to comply
with autoincrement fields that require they not be present. so,
put them all in for all primary key columns."""
# empty?: print "parameters rea:", self.parameters
for c in insert.table.primary_key:
if not self.parameters.has_key(c.key) \
and not insert.parameters.has_key(c.key):
self.parameters[c.key] = None
return ansisql.ANSICompiler.visit_insert(self, insert)
On Thu March 9 2006 10:33, Robert E. Anderson wrote:
> OK I found out a little more on this one.
>
> The problem is coming in from visit_insert() where self.parameters is found
> to be completly empty so it creates a None valued dictionary for every PK.
>
> Is there some other list/dictionary that should be tested for valid input
> values in this routine?
--
--------------------------------------------------------------
Robert E. Anderson email: [EMAIL PROTECTED]
Systems Programmer phone: (603) 862-3489
UNH Research Computing Center fax: (603) 862-1761
--------------------------------------------------------------
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users