[z3-five] "Could not adapt" problem

Martijn Faassen faassen at infrae.com
Fri Dec 17 16:58:19 MET 2004


Petri Savolainen wrote:
> My first stab at trying out five... I am trying to adapt
> 
> class OriginalItem:
> 
>    implements(IOrganizationItem)
>    ....
> 
> When I try adapted = IOrganizationRetrieval(OriginalItem()) I get a 
> 'Could not adapt', <OriginalItem instance at ...>, <InterfaceClass 
> IOrganizationRetrieval...>.
> 
> All seems as it should yet is not... any hints would be appreciated. The 
> interfaces, classes and zcml are here.

Odd, it looks fine just glancing through that code. One possibility is 
that for some reason your configure.zcml is not being read. If you 
introduce some error in it, does Zope complain about it on startup?

Does demos/FiveDemo run properly on your setup? It has almost the same 
configuration as yours.

Another possibility is that you try to run that code *before* the 
configure.zcml is being read.

Regards,

Martijn


More information about the z3-five mailing list