[Grok-dev] "Apply" a pagetemplate to an object and get html back
Lennart Regebro
regebro at gmail.com
Sat Jul 19 11:01:47 EDT 2008
On Sat, Jul 19, 2008 at 09:41, Achim Domma <domma at procoders.net> wrote:
> I don't understand your solution, but perhaps my question was not exact
> enougth. I have
>
> class Page(grok.Model):
> ...
>
> class Event(grok.Model):
> ...
>
> class TheView(grok.View):
> grok.context(Page)
> def render_body(self):
> here I use textile/markdown to format the body of
> the page. and I also want to iterate over a list of
> events and want to create a html snippet for each on.
>
>
> In the page template of TheView I will use the render_body method. So I
> could create a view for Event but then I still have to call them to produce
> some html for me.
Yup, that's exactly how you do it. Indeed you need to be more exact
with the qeustion. :)
--
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64
More information about the Grok-dev
mailing list