[Grok-dev] template association redux: module-level directives and inheritance

Jan-Wijbrand Kolman janwijbrand at gmail.com
Thu Sep 25 16:06:42 EDT 2008


Brandon Craig Rhodes wrote:
>     from BasicViews import SearchView
> 
>     class MoreSpecificSearchView(SearchView):
>         grok.template(grok.inherit)
>         ...
> 
> then I would know "Aha!  Instead of looking 'outward' through the outer
> levels of lexical scoping for where this template (or templatedir, if
> that is how I had done the example) comes form, I should look up its
> chain of inheritance, like I do when looking for something that follows
> "self." in a method."

My hope is that one would be able to apply "normal" OO logic for finding
out the behaviour of MoreSpecificSearchView - meaning that one'd be
looking at the baseclass for things one cannot find on the subclass.

I think Martijn's suggestion was about how to implement
grok.templatedir() and grok.template() such that when used by the
developers *with* grok, they can apply the same simple OO logic for
understanding where templates come from.


regards,
jw



More information about the Grok-dev mailing list