H
Harald Armin Massa
I use locals() for conveniently "filling out" SQL-Statements:
[snip]
def updData(id, surename):
sql="""update fisch set surename=%(surename)s where id=%(id)s"""
cs.execute(sql, locals())
[/snip]
that works great and is well within the definition of the python
db-api and is supported by pyPgSQL ... everything seems fine.
UNTIL
I read within psysco-FAQ and Jim Hugoninis IronPython paper: a lot of
words about "locals() being very difficult or impossible to optimize"
AND UNTIL
so ... is there any convenient replacement? Of course I could do
{"id":id, "surename":surename} , but that would be very very
in-elegant.
Harald
[snip]
def updData(id, surename):
sql="""update fisch set surename=%(surename)s where id=%(id)s"""
cs.execute(sql, locals())
[/snip]
that works great and is well within the definition of the python
db-api and is supported by pyPgSQL ... everything seems fine.
UNTIL
I read within psysco-FAQ and Jim Hugoninis IronPython paper: a lot of
words about "locals() being very difficult or impossible to optimize"
AND UNTIL
so ... is there any convenient replacement? Of course I could do
{"id":id, "surename":surename} , but that would be very very
in-elegant.
Harald