Hi Kevin,
Kevin Dangoor wrote:
> > I installed psycopg1 and followed their tutorial enough to create a
> > Person table without a problem, but tg-admin sql create still
> > complains
> > about no SQLObject driver. As I mentioned yesterday, my dev.cfg has
> > this line:
> >
> > sqlobject.dburi="postgres://[EMAIL PROTECTED]/tg"
> >
> > and I used the same string with connectionForURI() directly. In line
> > 316 of command.py, it's being called with self.options.connection_uri,
> > so I assume sqlobject.dburi somehow isn't making it down to
> > self.options.connection_uri, and I'm pretty sure someone will be kind
> > enough to tell me why that may be happening :-)
>
> Offhand, I'm not sure. Everything looks correct from what you're
> saying there.
>
Well, maybe a full traceback will provide more hints ...
> tg-admin sql create -c dev.cfg
Using database URI postgres://[EMAIL PROTECTED]/tg
Traceback (most recent call last):
File "/usr/local/bin/tg-admin", line 7, in ?
sys.exit(
File
"/usr/local/lib/python2.4/site-packages/TurboGears-0.8.9-py2.4.egg/turbogears/command/__init__.py",
line 186, in main
command.run()
File
"/usr/local/lib/python2.4/site-packages/TurboGears-0.8.9-py2.4.egg/turbogears/command/__init__.py",
line 106, in run
command.the_runner.run(sys.argv)
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/manager/command.py",
line 102, in run
runner.run()
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/manager/command.py",
line 233, in run
self.command()
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/manager/command.py",
line 542, in command
for soClass in self.classes(require_some=True):
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/manager/command.py",
line 255, in classes
conn = self.connection()
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/manager/command.py",
line 316, in connection
return sqlobject.connectionForURI(self.options.connection_uri)
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/dbconnection.py",
line 924, in connectionForURI
assert self.instanceNames.has_key(uri), \
AssertionError: No SQLObject driver exists under the name dev.cfg
I traced the execution path and it seems that TG command/__init__ tacks
on the dburi with a -c to the argv passed to sqlobject.manager's
command. Then apparently CommandCreate() calls the standard_parser()
which adds it to self.options.connection_uri. So, as you said
everything ought to work.
I have psycopg2 installed, for Trac (and also because I was
investigating SQLAlchemy first), but I installed psycopg1 today because
SQLObject requires it. I don't think that that should be a problem
since it looks like SO is screwing up before connecting.
Any suggestions?
Joe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---