29 Nov
2003
29 Nov
'03
9:54 p.m.
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