[Zope3-dev] Heads up: zope.app.intid and zope.app.keyreference are now optional

Ivo van der Wijk vladdrac at gmail.com
Wed Jun 15 18:51:52 EDT 2005


On 6/14/05, Jim Fulton <jim at zope.com> wrote:
> 
> In preparation for the 3.1 release, I made these packages (as
> well as zope.app.observable and zope.app.schema) optional and thus
> configured vie package includes.  If you have an instance that
> uses these, you will need to add package includes for these.
> 

I somewhat missed it - cubic started to work without much errors (the
catalog simply stopped working)

After fixing things/ adding includes, I ran into an old issue again (I
have clean Zope3 svn checkout at this moment, no additional
hacks/workarounds anymore):

  File "/home/ivo/Projects/Zope3/Zope3-svn/src/zope/app/security/adapter.py",
line 88, in __call__    adapter = self.factory(*args)
  File "/home/ivo/Projects/Zope3/Zope3-svn/src/zope/app/keyreference/persistent.py",
line 41, in __init__
    raise zope.app.keyreference.interfaces.NotYet(object)
NotYet: <zope.app.workflow.stateful.definition.State object at 0xb3bd076c>

The IntId utility can't handle these exceptions. The following diff
fixes things (for me, at least)

Index: intid/__init__.py
===================================================================
--- intid/__init__.py   (revision 30806)
+++ intid/__init__.py   (working copy)
@@ -158,7 +158,10 @@

     utilities = tuple(zapi.getAllUtilitiesRegisteredFor(IIntIds))
     if utilities: # assert that there are any utilites
-        key = IKeyReference(ob, None)
+        try:
+            key = IKeyReference(ob, None)
+        except NotYet:
+            key = None
         # Register only objects that adapt to key reference
         if key is not None:
             for utility in utilities:


Cheers

  Ivo



-- 
Drs. I.R. van der Wijk                                      -=-
Korte Leidsedwarsstraat 12                                 Amaze
1017 RC Amsterdam, NL                                       -=-
T +31-20-4688336         F +31-20-4688337       Zope/Plone/Content Management
W http://www.amaze.nl    E info at amaze.nl           Open Source Solutions
W http://vanderwijk.info E ivo at amaze.nl                 Consultancy
PGP http://vanderwijk.info/pgp


More information about the Zope3-dev mailing list