I'm trying to use Team Calendar plugin with a PostgreSQL-based Trac
installation. The plugin is clear about using MySQL and needing more
database-agnostic implementation. I've been playing with it and run
into a problem with the "upsert"
insert_cursor.execute("INSERT INTO %s (ondate, username, "+
"availability) VALUES %s "
"ON DUPLICATE KEY UPDATE availability = "+
"VALUES(availability)" %
(self.table_name,
", ".join(["('%s', '%s', %d)" %
(t[0], t[1], t[2] and 1 or 0,)
for t in tuples])))
http://stackoverflow.com/questions/1109061/insert-on-duplicate-update-postgresql
discusses the problem but none of the solutions seem to apply well to
SQL embedded in Python for Trac. I'm left wondering if the Trac DB
layer has any support for this but I'm quite inexperienced in that area.
Can someone point me in the right direction?
Chris
--
Christopher Nelson, Software Engineering Manager
SIXNET - Solutions for Your Industrial Networking Challenges
331 Ushers Road, Ballston Lake, NY 12019
Tel: +1.518.877.5173, Fax: +1.518.877.8346 www.sixnet.com
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en.