[Zope] Naming conventions
Dylan Reinhardt
zope at dylanreinhardt.com
Sat Nov 29 16:54:18 EST 2003
On Sat, 2003-11-29 at 12:11, Brad Allen wrote:
> This sounds interesting, but I'm a newbie and am not clear on what
> you mean here. How do you wrap all non-Python script objects?
*How* is easy. If you have an object my_object you want to "wrap" with
the Python Script call_my_object, you'd do this:
call_my_object:
-----
# do other stuff
return context.my_object(arguments)
-----
As for *why* you might do this, there any many possible reasons.
Sometimes it's just cleaner to put scripts in charge of templates than
vice versa. It's also a good way to ensure that templates are being
passed sane/validated/correctly-typed arguments. It's much easier to do
validation work in a script than a template.
HTH,
Dylan
More information about the Zope
mailing list