KLEIN Stéphane wrote:
I read IntIds apidoc, I see :

#  register(ob)
Interface : zope.app.intid.interfaces.IIntIdsSet
Permissions : zope.ManageContent (lecture), non disponible (écriture)

When quoting things from the Zope ZMI, I suggest switching to English first. Not everyone understands French.

in lib/python/zope/app/intid/tests.py I see :

class P(Persistent):

and too far :


       u = IntIds()
       obj = P()

       uid = u.register(obj)

When, in debugzope I test :

       u = IntIds()
       obj = object()

       uid = u.register(obj)

this don't work.

"it doesn't work" is not a proper error description. We can't help you without knowing *what's* going wrong on your side.

By the way, it probably doesn't work because you're missing an adapter for 'obj' to IKeyReference. This is necessary to make it work and required by intid utilities as documented in one of the zope.app.intid interfaces:

  class IIntIdsSet(Interface):

      def register(ob):
          """Register an object and returns a unique id generated for it.

          The object *must* be adaptable to IKeyReference.

          If the object is already registered, its id is returned anyway.

So, you first need to register an IKeyReference adapter for your 'P()' object.

Where can I found documentation about IntIds ?

My new book :)

Zope3-users mailing list

Reply via email to