[Grok-dev] AddForm Mystery Number

Sebastian Ware sebastian at urbantalk.se
Thu Jun 4 08:54:36 EDT 2009


I use auto generated forms extensively. I set up the form in my  
grok.EditForm/AddForm and render it using a macro called  
[form_template] in a view called [editformtemplate] using:

   <tal:block metal:use-macro="context/@@editformtemplate/macros/ 
form_template" />

I also render these forms from a grok.View (for sub forms in a page).  
It requires me to keep track of refering page. I call the sub edit  
form by setting the object to display (in this case self.edit_object)  
on my grok.View and then using:

   <tal:block condition="view/edit_object" replace="structure view/ 
edit_object/@@subeditform" />

The [subeditform] is aware that it has been called by a grok.View and  
redirects to that view once it has performed updates in the action  
handler.

Mvh Sebastian

2 jun 2009 kl. 05.09 skrev Steve Schmechel:

>
> So my real mistake was introducing whitespace into the "label"  
> parameter of @grok.action.
>
> I understand why the whitespace would be a problem, but why isn't it  
> simply removed instead of falling all the way back to ugly hex  
> encoding?
>
> Oh well, not a Grok problem.
>
> I guess I am back to wondering if it is good practice to call an  
> auto-generated form view from another template.  I could try to link  
> the names together with a global constant in my code and expose it  
> as a variable to my template.
>
> Is there a more elegant way to inject an auto-generated AddForm into  
> a portion of a Grok view?
>
> I'm sure there is a whole world of viewlets and such about to be  
> recommended to me. :-)
>
> More simply, I'll ask again:
>
> - Does anyone really use auto-generated forms as a basis for real  
> world projects, or are they just cool tools to use in demos and  
> example code?
>
> - Should I just figure that any serious development requires a  
> complete set of some flavor of custom page templates for each view/ 
> form?
>
> Thanks,
> Steve
>


More information about the Grok-dev mailing list