[Zope3-Users] Default value for an interface attribute

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Thu Mar 1 10:29:22 EST 2007


> I have this interface:
>
> class INews(IPage):
>     """A news page for the application.
>     """
>
>     date = Date(
>         title=_(u"Publication Date"),
>         description=_(u"The intended date for this news"),
>         default=date.today(),
>         required=False
>         )
>   
With formlib (in Five in fact, not with Zope3) I was creating
form_fields that should have dynamic defaults in __call__
method of formlib's AddForm (EditForm)
view. I think it is not nice solution so I'd love to see
better way of doing this.

-- 
Maciej Wisniowski


More information about the Zope3-users mailing list