[Grok-dev] How do I get current day as default in interface schema definition?
Jan-Wijbrand Kolman
janwijbrand at gmail.com
Tue Feb 17 08:50:38 EST 2009
On Tue, Feb 17, 2009 at 2:41 PM, Steve Schmechel
<steveschmechel at yahoo.com> wrote:
>
> I ran into this same problem and was confused by other examples I found in other sample code that are written like you suggest.
>
> Don't these contradict the warning in the "Customising Fields in Grok" how-to, which explicitly states no to do something like this in your add form? (It mostly warns about changing the field name, but setting the default is included in the example.)
>
> See the "Further Information" section in:
>
> http://grok.zope.org/documentation/how-to/customizing-form-fields-in-grok-forms
The example warns for modifying the (schema)field attribute on the
form(field) object. This is confusing. But, the FormField objects that
come from grok.AutoFields are wrappers around zope.schema Field
objects. If you would modify the latter, it indeed propagate
throughout the runtime.
The FormFields however are pre-request and do have hooks for local
modifications.
Does this make it anymore clear?
regards,
jw
More information about the Grok-dev
mailing list