Re: [Zope3-Users] Re: Default value for an interface attribute

2007-03-12 Thread Maciej Wisniowski
How about checking whether the value of 'default' is a callable and if so call it to obtain the default value. Yup... but evaluation of this is done internally by Zope schema package in Field class I think. Seems for me that there is no way to define 'default' as callable.

[Zope3-Users] Re: Default value for an interface attribute

2007-03-01 Thread Raphael Ritz
Maciej Wisniowski schrieb: I have this interface: class INews(IPage): A news page for the application. date = Date( title=_(uPublication Date), description=_(uThe intended date for this news), default=date.today(), required=False ) With

Re: [Zope3-Users] Re: Default value for an interface attribute

2007-03-01 Thread Douglas Douglas
--- Raphael Ritz [EMAIL PROTECTED] wrote: How about checking whether the value of 'default' is a callable and if so call it to obtain the default value. That way defautl=date.today (without the ())should do what Douglas expects (maybe this is even the case already?). I tried

Re: [Zope3-Users] Re: Default value for an interface attribute

2007-03-01 Thread Maciej Wisniowski
How about checking whether the value of 'default' is a callable and if so call it to obtain the default value. Yup... but evaluation of this is done internally by Zope schema package in Field class I think. Seems for me that there is no way to define 'default' as callable. -- Maciej

Re: [Zope3-Users] Re: Default value for an interface attribute

2007-03-01 Thread Christian Theune
Hi, Am Donnerstag, den 01.03.2007, 16:54 +0100 schrieb Maciej Wisniowski: How about checking whether the value of 'default' is a callable and if so call it to obtain the default value. Yup... but evaluation of this is done internally by Zope schema package in Field class I think. Seems for