[Zope-dev] zope.app.publication dependencies (volunteers needed!)

Chris McDonough chrism at plope.com
Thu May 14 19:10:25 EDT 2009


On 5/14/09 6:36 PM, Hanno Schlichting wrote:
> Chris McDonough wrote:
>> I did a bit of research on the direct "zope.app.*" dependencies of zope.formlib.
>>
>> - I looked into its dependency on zope.app.pagetemplate.
>>     It defines two "named templates" in its form.py module using
>>     The ViewPageTemplateFile class from zope.app.pagetemplate.
>>     Each is registered in its configure.zcml as adapter with the
>>     name "default". I don't have enough zen to know what the intent
>>     is here or whether the named templates could use
>>     zope.pagetemplate instead.
>
> This is part of the whole named template adapter story. The rationale
> for the whole story is to be able to replace the template of a view
> without touching the view. So the template is looked up as an adapter
> and not just accessed as self.index / self.template. Personally I find
> the whole feature just annoying and overcomplicated. I think the whole
> feature is due for removal. It's only used in a very minor number of
> cases and not consistently with views in general.
>
>> - I looked into its dependency on zope.app.form.  It
>>     essentially uses a bunch of interfaces from the
>>     zope.app.form.interfaces package.  I don't know whether it
>>     would be reasonable to move all those interfaces
>>     to zope.browser or somewhere else, but essentially
>>     moving those interfaces to somewhere "neutral"
>>     would break this particular dependency.
>
> Why not move the interfaces to zope.formlib and invert the dependency,
> so zope.app.form depends on zope.formlib? Or are these generally useful
> outside of a formlib context?

That's possible.

A Google search indicates that zope.app.form.interfaces is being used by:

- zope.formlib

- schooltool

- plone (maybe)

- alchemist

- sputnik (an openplans project)

- collective.easyslider

- zc.extjs

- zenoss

- alphaflow

It's also apparently documented in Phillip's book.  So... what?  Errrr... I 
dunno.  The interfaces are:

from zope.app.form.interfaces import IInputWidget, IDisplayWidget
from zope.app.form.interfaces import InputErrors, WidgetInputError
from zope.app.form.browser.interfaces import IWidgetImportErrorView

Any thoughts?

- C


More information about the Zope-Dev mailing list