Fwd: [Product-Developers] Re: Help identify Plone's API

Mikko Ohtamaa mikko+plone at redinnovation.com
Tue May 26 16:17:42 UTC 2009


>> How to register and manipulate Z3 registeries (adapters, subscribers, viewlets, views) from Python in Plone context.
>
>
> Actually, I would discourage this. Maybe some functions should be mentioned under the 'testing' banner, and possibly some of the introspection stuff would be useful, but we should be careful.


>
>> Five/site awarness/etc.  adds extra complexity for this and Zope 3
>
> > documents cannot be applied
>>
>> for Plone as is.
>
> Are you sure? I'm pretty sure the basic zope.component APIs work just fine in Plone.

I was little too hasty when narrowing problems down to zope.component
- you are actually right, it is not the main culprit here. There are
subtle differences driving you crazy. Especially when the black magic
is not explained anywhere.

E.g.

1) You need to use Five classes (BrowserView) instead of Zope 3 one.
(Acquisition magic)

2) request.locale is missing (see
http://svn.zope.org/plone.z3cform/trunk/plone/z3cform/z2.py?rev=88331&view=markup
)

3) zope.component.getGlobalSiteManager() should not be used (as in
zope.component tutorial), instead use getSiteManager(context)

So actually we need a list of "DON'T DO THIS" and "If you get this
exception you have done this wrong" , the latter useful especially for
acquisition problems

-Mikko



-- 
Mikko Ohtamaa
Managing director, Red Innovation Ltd.
+358 40 743 9707
www.redinnovation.com
Every problem is solvable if you can throw enough energy drinks at it




More information about the Product-Developers mailing list