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 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
--- 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
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
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