[Grok-dev] Re: Grok Widgets / Fields (Was Re: Re: [grok-br] Grok 1.0 and beyond)

Fernando Correa Neto fcdoth at gmail.com
Fri Jan 11 12:59:20 EST 2008


Hey

On Jan 11, 2008 3:32 PM, Sebastian Ware <sebastian at urbantalk.se> wrote:
> 11 jan 2008 kl. 08.15 skrev Luciano Ramalho:
>
> > Sebastian, the code in default_edit_form.pt also iterates over the
> > widgets to render them, it just does so using tal:repeat, not Python
> > code.
>
> Does anybody have some simple sample project using the
> deafult_edit_form method that I could examine? I am trying to
> understand the grok form doctests, but I am feeling a bit neanderthal.

Maybe. This is little app [1] that Phillip did does all the CRUD
basically. So it has a add form and a edit form which uses the
default_edit_form.pt (since it is default).

>
> And also, is [default_edit_form.pt] a site wide replacement of the
> page template associated to my edit class or only used to render the
> form? I don't quite get how they all fit together.

IIRC, yes. All edit forms will use that template to render the form.
If you want to override it so it can be integrated in your skin for
example, you just need to override the template variable in your edit
form class. Take a look at grok.EditForm in components and look for
default_form_template variable and it should enlighten you....a little
:).

Regards,
Fernando

[1] http://wiki.zope.org/zope2/GrokExample


More information about the Grok-dev mailing list