"Phillip J. Eby" a écrit :
> >So: retrieveItem, createItem use vanilla objects
> retrieveItem and createItem are not intended to be public methods; the only
> reason they don't begin with an "_" is that I wanted to make it possible
> for them to be implemented as DTMLMethods or PythonMethods.
you missed the point. I wasn't that clear neither ;-)

I know that retrieveItem and createItem are not public API, and are
meant to be overidable.
I believe that telling the rackmountable what rack it belongs to in
getItem and newItem it not sufficient. It has to be wrapped in the
context of the rack with something like:

# this works for me
item = self.retrieveItem(key)
if item is not None:
        return item.__of__(self) # keep other acquisition wrappers,
                                # no need to get aq_inner


# untested
item = self.retrieveItem(key)
if item is not None:
        rack = self.aq_inner
        return item.__of__(rack)

When I don't wrap items like this, I get strange unauthorized errors.
Only the super user can use the items. All the other users (Managers or
not) can't.

Remember that I use python classes as rack-mountables, and they don't
get the fancy acquisition wrapping that zclasses get.

jephte clain

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to