On Fri, Oct 19, 2007 at 08:10:12PM +0200, Hilbert, Sebastian wrote: > Looks like we are still experiencing problems with GNUmed in Ubtuntu 7.10 > psycopg2 and GNUmed don't match. There seems to be no way to change that > unless we patch GNUmed 0.2.6.3 to work with psycopg2.
Attached find a patch. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
--- gmPG2.py.orig 2007-06-09 19:39:10.000000000 +0200 +++ gmPG2.py 2007-10-19 23:26:36.000000000 +0200 @@ -798,8 +798,12 @@ psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) psycopg2.extensions.register_type(psycopg2._psycopg.UNICODEARRAY) -# properly adapt *tuples* into (a, b, c, ...) in "... IN ..." queries -psycopg2.extensions.register_adapter(tuple, psycopg2.extras.SQL_IN) +try: + # properly adapt *tuples* into (a, b, c, ...) in "... IN ..." queries + psycopg2.extensions.register_adapter(tuple, psycopg2.extras.SQL_IN) +except AttributeError: + # only needed in psycopg2 < 0.2.6 + pass # do NOT adapt *lists* to "... IN (*) ..." syntax because we want # them adapted to "... ARRAY()..." so we can support PG arrays
_______________________________________________ Gnumed-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnumed-devel
