[Grok-dev] how getting data to view?!
nnieto at noenieto.com
Sun Nov 20 15:26:47 UTC 2011
2011/11/12 Tamer Higazi <th982a at googlemail.com>
> Hi people!
> I am reading this amazing grok book (just bought it a short time ago),
> and I thought of writing something that is for me a bit unclear, because
> that isn't described here.
> In the ZPT Template we got this:
> <div id="testX2">
> <li tal:repeat="weapon python:view.weapons"
> where and how has the method weapons to be created that returns the
> list, that creates me these entries?!
It can be a method or an iterable attribute
> I suggest in "app.py" that looks like this at the moment:
> import grok
> from grokhelloworld import resource
> class Grokhelloworld(grok.Application, grok.Container):
> class Index(grok.View):
weapons = ['spear', 'rock']
> def update(self):
> Grok-dev mailing list
> Grok-dev at zope.org
NNieto Consulting Services
M: nnieto at noenieto.com
T: @tzicatl <https://twitter.com/#%21/tzicatl>
Li: Perfil en LinkedIn <http://www.linkedin.com/profile/view?id=84300665>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Grok-dev