[Grok-dev] grokcore.resource

Jan-Jaap Driessen janjaapdriessen at gmail.com
Mon May 14 19:02:27 UTC 2012

After the recent grok sprint I have spent some hours taking parts of
megrok.resource and putting them in the grokcore.resource package:


grokcore.resource helps you use fanstatic resources in your view
components. Instead of `needing` resources in the update method of
your view components, you can use a directive to associate resources
with a view component, so instead of::

class MyView(grok.View):
    def update(self):

You write::

class MyView(grok.View):

This removes a lot of one-line update methods from our code base,
which is good. grokcore.resource works for grok.View, grok.Viewlet,
grok.Layout and grok.ContentProvider view components.

Are you ok with making this a part of grok? I created a branch of grok
in which I incorporated grokcore.resource:


I would like you to try this out in your own applications. Let me know
if you have any questions.


More information about the Grok-dev mailing list