[Zope-dev] Make simple ISource usable

Roger Ineichen dev at projekt01.ch
Sat Aug 30 10:54:57 EDT 2008


Hi Chritian

> Betreff: Re: [Zope-dev] Make simple ISource usable
> 
> On Fri, 2008-08-29 at 15:01 +0200, Roger Ineichen wrote:
> > [...]
> >
> > The only query API defined for ISource in zope.schema is the 
> > ISourceQueriables API. That's defently to less and makes it 
> required 
> > to implement custom query APIs in UI frameworks if we need to work 
> > with terms.
> > 
> > I no one objects, I'll start a zope.schema branch and let you know 
> > about the progress and a hopfully a simple solution. Additional to 
> > them I started allready a z3c.form branch for adjust the ITerms 
> > implementation.
> > As far as I can see right now this refactoring will only provides 
> > additional features.
> > 
> > What do you think? Any objections or hints about that?
> 
> Terms require access to a request. Any application's model 
> code should be happy to only deal with the values of sources.

I agree, ITerm lookup from an ISource should work without the request.

> Terms are used to map values to the UI parts of an 
> application (by providing identification tokens and user 
> readable titles).
> 
> IMHO zope.schema doesn't need to know about terms.

I agree if you think about the ITerms adapter pattern
like defined in zope.app.form using (source, request)
as discriminators.

But zope.schema does already know about term. ITerm is a 
part of zope.schema. ISource uses ITerm as items. But 
the only query API is ISourceQueriables. There is no 
simple query API for work with terms.

> I do agree that the whole issue of searching/querying sources 
> is currently underdesigned.

What do you think about an ITerm interface next to the
ISourceQueriables interface. This interface could offer
getTerm and getValue and offer a base for access none 
queriable ISource implementations.

Of corse such a ITerms adapter for ISource doesn't adapt
the request. The PrincipalSource ITerms implementation
from zope.app.security doesn't even use the implemented
request.

Probably we should named the new interface in zope.schema
ISourceTerms instead of ITerms?

Regards
Roger Ineichen

> Christian
> 
> --
> Christian Theune · ct at gocept.com
> gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) 
> · germany http://gocept.com · tel +49 345 1229889 7 · fax +49 
> 345 1229889 1 Zope and Plone consulting and development
> 



More information about the Zope-Dev mailing list