[Grok-dev] returning the contents of a page template in a method
sebastian at urbantalk.se
Mon Nov 5 09:51:30 EST 2007
From a pagetemplate, you could call it like this:
<tal:block replace="structure view/the_object/@@myappform" />
Where self.the_object is set in the update() method of the view class.
To call it from code you want to use "getMultiAdapter".
Try something like (not tested...):
the_view = zope.component.getMultiAdapter((content, request),
Search for "getMultiAdapter" in the Zope 3 source code and you will
probably find some sample code etc.
5 nov 2007 kl. 00.45 skrev David Bain:
> I have an object (a grok.Application), I use self.context to
> retrieve it and get something like this [<myapp.app.MyApp object at
> I have a page template location src/myapp/app_templates/myappform.pt
> I'd like to be able to call myappform.pt in a method
> something like:
> output = self.context.myappform()
> return output
> Just not sure how to do this. Any pointers would be helpful
> Grok-dev mailing list
> Grok-dev at zope.org
More information about the Grok-dev