[Zope-dev] Make simple ISource usable

Roger Ineichen dev at projekt01.ch
Mon Sep 1 04:21:11 EDT 2008


Hi Christian

> Betreff: Re: [Zope-dev] Make simple ISource usable

[...]

> > Are you arguing that zope.schema.Field should not have a title 
> > attribute?
> 
> No no no, sorry :)
> 
> I only don't see why I need titles for a source all the time. 
> If you need both tied toogether (which frankly quite often is 
> the case) zc.sourcefactory does the right thing (for me). If 
> you just need to define a set of values you can just define 
> the source (i.e. 
> __contains__).

You've got the point zc.sourcefactory does the right thing for 
you. Do you know why?

It uses the bridge to the widget world. It offers component
from ISource to ITerms.

e.g.
class MappedTerms(object):
    """A terms implementation that knows how to handle a source that was 
    created through a source factory.
    """

    zope.interface.implements(zope.app.form.browser.interfaces.ITerms)


This very important ITerms interface which other widget framework
can use should be a part of zope.schema and not zope.app.form

Right now only the zope.app.form offering the missing part and makes
the ISource working. I don't think every widget framework should 
depend on zope.app.form. And other framework can not reuse zc.sourcefactory
because z3c.form will never depend on zope.app.form.

Right now it's a of;
If we move ITerms from zope.app.form, then we can useit in z3c.form
and reuse all existing ISource implementations whihc offer ITerms
support within z3c.form out of the box. If this interface will stay
in zope.app.form we never can use such ITerms/ISource component.

Of corse we could remove the request as a required adapter 
discriminator from ITerms by default.

Regards
Roger Ineichen

> --
> Christian Zagrodnick · cz at gocept.com
> gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) 
> · germany http://gocept.com · tel +49 345 1229889 4 · fax +49 
> 345 1229889 1 Zope and Plone consulting and development
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )
> 



More information about the Zope-Dev mailing list