[Zope3-Users] zc.relationship or hurry.query and global intid utility

Shaar Gabriel gabi at shaargiora.co.il
Sun Jan 7 07:06:18 EST 2007


hi. thanks for the quick reply.

On Saturday 06 January 2007 21:40, FB wrote:
> On Sat, Jan 06, 2007 at 08:14:52PM +0200, Gabi Shaar wrote:
> > hi.
> > i am trying to use zope 3.3.0
> >
> > first somebody correct me if i'm wrong.
> >
> > getUtility(IIntIds) looks for an intid utility registerd in the global
> > site manager. if i supply a context, then it looks in the local site.
> >
> > i am trying to use zc.relationship and hurry.query. both seem to look for
> > a globally registered intid/catalog utility (at least as i understand
> > it). i can only wrap my brain around how to create a local intid/catalog
> > utility.
> >
> > could somebody point me at a simple example of how to create the intid
> > utility these packages are looking for ?
>
> Go to the site manager:
>
>  http://zopeserver/++etc+site/default
>
> create a IntId-Utility by selecting it from the "Add object" menu. Change
> to the newly create intid, select the "Registration" tab and add a
> registration.

did that. zmi now sais :
This object is registered: 
zope.app.intid.interfaces.IIntIds utility

>
> The next time, getUtility(IIntIds) should return that object.
>
> This utility is the one thing you should create before any other object
> because objects created prior to this utility will never have a unique ID.
>

a debug session :
daemon manager not running
zopectl> start
. ------
2007-01-07T13:55:52 INFO root daemonizing the process
daemon process started, pid=13163
zopectl> stop
. daemon process stopped
zopectl> debug
No handlers could be found for logger "ZODB.FileStorage"
>>> from zope.component import getUtility
>>> from zope.app.intid.interfaces import IIntIds
>>> getUtility(IIntIds)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/zope-3.3.0/lib/python/zope/component/_api.py", line 207, in 
getUtility
    raise ComponentLookupError(interface, name)
zope.component.interfaces.ComponentLookupError: (<InterfaceClass 
zope.app.intid.interfaces.IIntIds>, '')

> Regards,
>
> Frank
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users


More information about the Zope3-users mailing list