[Grok-dev] Re: template syntax
Philipp von Weitershausen
philipp at weitershausen.de
Wed Jan 10 12:15:04 EST 2007
Christian Theune wrote:
> Am Mittwoch, den 10.01.2007, 11:06 -0500 schrieb Gary Poster:
>> The whole template folder thing sits particularly badly with me, even
>> trying to put on the hat of a developer whom you are targeting. grok
>> is reveling in automation, which as we well know from Zope 2 can
>> become "magic" when it obscures. The automatically-found *_template
>> folder seems too disconnected and magic for me to understand as I
>> read the code in your example modules. A simple explicit connection
>> would make me understand what's going on when looking at a grok
>> module better, I think; it would also avoid the unfortunate naming
>> issue in the blog package ("page_template", if I recall) because the
>> name could be chosen explicitly.
> Thanks for that feedback.
> You *can* choose it explicitly now already, however, I agree that the
> default isn't very sensible. Especially in the page_template case.
> Looks like we have to keep thinking about that one.
Thanks to Gary for the feedback.
I actually like the convention. page.py and page_templates (it's plural
which makes a huge difference IMO!) make a lot of sense to me, though I
agree it could be better. I guess page.py is an unfortunate name.
Looking at grokblog and grokwiki, I must say I find the naming quite
nice. I'm in blog.py and looking for the template that renders this or
that? Well, I go into blog_templates. Same for calendar.py, entry.py, etc.
Naming conventions often tend to have edge cases where the rule sucks.
But that doesn't mean you can't come up with better names than page.py.
http://worldcookery.com -- Professional Zope documentation and training
2nd edition of Web Component Development with Zope 3 is now shipping!
More information about the Grok-dev