Stefan H. Holek wrote:
My take is that it's not the TAL features (tal:define, python:, whatever) that invite misuse, but the available namespaces.

I have ported ZPT to Django [1][2] and found the experience surprisingly refreshing. Django naturally does not have anything like "container" or "context" in the Zope sense. And by Django policy, templates don't even get to see the "request". The namespace Zope PTs call "options" becomes the sole, top-level namespace in Django PTs.

This very effectively keeps me from pulling-in anything not provided by the view in the first place. Everything -- even functions I want to call in, say, conditions -- has to be added by the view. The result is clean and fast templates.

This sounds like best practice to me.

> [2]

I would even go a step further and leave the macro mapping to the view and write

  <html metal:use-macro="macros/master"/>

instead of

  <html metal:use-macro="templates/myapp/main/macros/master"/>

. Thus making the template more generic.


Zope3-dev mailing list

Reply via email to