On 18/12/05, Rubic <[EMAIL PROTECTED]> wrote:
>
> > pass the object with the many attributes in the dicttionary,
> > and reference them in the kid template.
>
> Thanks, Davy.  That had occurred to me, but I wasn't sure if it fit the
> conventional TG approach.  So it wouldn't be considered abusive to
> write code that looks like this, correct?
>
> def method(self):
>     return dict(obj=self)
> ---
> <span py:content="obj.attributeX"> attributeX </span>
> <span py:content="obj.attributeY"> attributeY </span>
> ... etc.

Yes, that fine by my book :). One of the nice things about kid is that
its exposes pretty much the whole of python in the template. This
allows you complete access to your carefuly crafted objects, with
attributes, methods, properties, metaclasses, etc. As opposed to some
stripped down custom language, like many other templating engines.


--
wavy davy

"True religion confronts earth with heaven
and brings eternity to bear on time"
 - A. W. Tozer

Reply via email to