[Zope3-dev] There's something wrong with having message ids in schemas

Martijn Faassen faassen at infrae.com
Thu Dec 9 08:49:29 EST 2004


Stephan Richter wrote:
[snip]
>>>1. It makes zope.index depend on zope.i18nmessageid
>>
>>Can't Zope 3 message id imports go through some very small dummy package
>>which provides a dummy message id if i18nmessage id is unavailable? It'd
>>be less painful perhaps to have to just depend on that.
> 
> 
> Yes, I was about to suggest the same:
> 
> try:
>   from zope.i18nmessageid import MessageIdFactory
>   _ = MessageIdFactory('domain')
> except ImportError:
>   _ = unicode
> 
> This way you only have a soft dependence of zope.i18nmessageid

That isn't enough if you want to use the 'mapping' attribute
for interpolation (or is this different in zope 3?), and there is the 
question of the second 'domain' argument, but a little bit more code 
will do it.

[snip]
>>Tied into this, a layer that I miss a bit in the current schema/form
>>system is that the way to construct an actual form is hidden away under
>>a layer of ZCML and automation and becomes rather hard to find.
>>Sometimes you'd like to have just a form without having a content object
>>that complies with a particular schema. I'm not saying we shouldn't have
>>a schema for this form, but the schema is free-standing and not
>>associated with any particular content object. It might be part of the
>>view only.
> 
> This is actually planned for the 3.1 release. We will provide a browser:form 
> directive that that is only responsible to display the form based on a schema 
> and will leave the `update()` method for the developer to fill out.

Ah, cool! I should get involved in that. Might also be more easily 
amenable to use in Five..

Regards,

Martijn




More information about the Zope3-dev mailing list