[Zope3-Users] sqlos, sites and local utilities

Andreas Elvers andreas at work.de
Tue Nov 8 05:38:59 EST 2005


Hi,

sorry for asking it here but sqlos mailing list seems dead.

Has anyone yet tried sqlos with database connections created as local 
utilities ? At one point sqlos tries to get the utility in connection.py 
Line 88.

  newconn = zapi.queryUtility(IZopeDatabaseAdapter, name,
                                                     default=None,
                                                     context=context)

The context points to a sqlobject instance. The problem is that these 
instances seem to have no parent and thus will fail the lookup my local 
utility and will raise an 'NoneType' object is not callable error later 
in the code when trying to adapt.

When you try the sqlos example everything is fine, since the database 
connection is defined in configure.zcml as a global utility.

My current idea is to expose the enclosing folder as a context to query 
utility. But I don't know if setting references in sqlobject instances 
is such a great idea.

Thanks for any input,
- Andreas



More information about the Zope3-users mailing list