[Grok-dev] A Little Update: Trying It using Macros

rmoskal rmoskal at mostmedia.com
Wed Aug 13 18:26:15 EDT 2008


To keep busy, I decide to work around my problem by using macros instead of
the viewlets for my layout.   Interestingly enough, in doing so I get rid of
like 70% of the code in my application.  Most of which involved wrapping the
forms a la

http://grok.zope.org/documentation/how-to/using-viewlets-for-layout

So now the code looks nice and pretty again. And it takes only a short time
to replace all the viewlet code with macros.

Again, I'm stopped short.  It seems as if I can't show the stock
grok.AddForm, grok.EditForm goodness within my my layout.  It appears theres
no way to call my layout macro and use the default forms.  This is what I
gather from the developer notes:

http://grok.zope.org/documentation/developers-notes/

The notes tell me that I can  reproduce the default rendering logic on my
own.  But I want to use the default zope forms.  They are sufficient for my
purposes. I don't want to reproduce their logic in my application. I want
the magic form autogeneration, I deserve it.

In all fairness I haven't spent very much time on this. I hit both these
walls very quickly (which would not be the case with most other frameworks). 
However, hit the wall I have.  I would LOVE to use GROK for some upcoming
projects, but I want to use the autogenerated forms whenever possible, and I
want to control the layout of my application. 

I'm looking for the maximally elegant and productive web framework for a
certain class of project. On the surface GROK looks like it, but I'm
scratching and am getting discouraged. I think these are pretty common use
cases.  

Using viewlets I want to have a choice of auto generated forms to show for a
given context.

Even better (since forms and viewlets are messy) I want to be able to use a
macro for my layout and have the autogenerated form use this macro (to wrap
itself in).

Any pointers would be obliged.  I hope our exchange here will help others in
evaluating GROK.

Thanks and regards,

Robert Moskal



-- 
View this message in context: http://www.nabble.com/Viewlets-for-Layout--Multiple-Forms-per-Context-tp18956744p18972365.html
Sent from the Grok mailing list archive at Nabble.com.



More information about the Grok-dev mailing list