PGP SIGNED MESSAGE
Hash: SHA1
Lennart Regebro wrote:
7/3/06, Chris McDonough
<chrism (AT) plope (DOT) comwrote:
>Actually, I think python: expressions perform slightly better than
>their path: counterparts because their evaluation step needs to do
>less work (no guessing about getitem vs. getattr). Geoff Davis
>taught me that. But in the end it's all dwarfed by the penalty
>imposed by security, so it really doesn't much matter.
Right. So the best and quickest is to prepare all the data in pure
disk-based python.
It's easy to do if you use the view methodology you get with Five, but
there are other ways to do it if you don't want to use views.
My 'pushpage' package is an attempt to make this the "standard" pattern
(pushpage templates don't have *any* top-level names available to them
(i.e., 'context', 'container', 'request', etc.) except those passed to
their '__call__' as keyword arguments (which traditional ZPT exposes
under 'options'):
The templates can be used from within methods of view classes, and can
also be published as "pages" via ZCML with the help of a user-defined
callable which computes the keyword arguments. E.g.:
<pushpage:view
for=""
name="somepage.html"
permission="zope.Public"
template="templates/sometemplate.pt"
mapping=".somemodule,somefunction"
layer="mylayer"
/>
In this example, 'somemodule.somefunction' returns the mapping which
'sometemplate' will use as its top-level namespace. The callable is
passed 'context' and 'request' as arguments.
Tres.
- --
Tres Seaver +1 202-558-7113 tseaver (AT) palladion (DOT) com
Palladion Software "Excellence by Design" http://palladion.com
PGP SIGNATURE
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
gN4Q7fIm63hA4HUoViIwdBk=
=2aTX
PGP SIGNATURE
Zope maillist - Zope (AT) zope (DOT) org
** No cross posts or HTML encoding! **
(Related lists -
)