Post by Ernesto RevillaHi,
Modeling.Adaptor.GeneralAdaptorException: Unable to find either psycopg, pgdb or pypgsql
Right, we can consider this as a bug: the absence of underlying py
adaptor for PostgresqlAdaptor shouldn't raise a fatal error (maybe just
a warning) until it is really needed --which is not the case at import
time. If you find some time, please submit a bug report at sf.
You'll find attached a quick-n-dirty patch. Thanks for reporting!
-- Sébastien.
Index: test_SchemaGeneration.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_SchemaGeneration.py,v
retrieving revision 1.6
diff -u -r1.6 test_SchemaGeneration.py
--- test_SchemaGeneration.py 14 Feb 2004 18:17:21 -0000 1.6
+++ test_SchemaGeneration.py 17 Mar 2004 06:48:36 -0000
@@ -62,6 +62,11 @@
modelSet=ModelSet.ModelSet()
modelSet.addModelFromXML({'file': xmlmodelPath})
model=modelSet.modelNamed('simpleModel1')
+ try:
+ import psycopg
+ except ImportError:
+ import sys
+ sys.modules['psycopg']=1
pgAdaptor=Adaptor.adaptorWithModel(model)
class TestSchemaGeneration(unittest.TestCase):