Re: How do I reference functions from another template?

Jean-Baptiste Quenot <[email protected]>
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
2009/5/5 R. Tyler Ballance <[email protected]>:
> On Mon, May 04, 2009 at 09:34:03PM -0400, Saul Jaspan wrote:
>> Lets say I have a template, dir1/dir2/dir3/foo.tmpl:
>>
>> #def FooFunct($param1, $param2):
>>   Stuff here
>> #end def
>>
>> and another template where I want to call FooFunct, dir1/base.tmpl:
>>
>> #include "dir1/dir2/dir3/foo.tmpl"
>> #* Want to call $FooFunct("1", "2") *#
>
>
> Tavis and I have talked about starting to try to phase out the "#include"
> statement so I wouldn't exactly recommend it if you can avoid it.

Interesting, we use #include everywhere so that the template writers
can write their templates without having to compile them by hand.  How
would I automatically compile referenced templates?

Do you remember my patch about not checking the last modification date
of included files?  I only use it in production to avoid stat() system
calls, but in development it's very handy!

Anyway if you drop support for #include I think I'll have to stay with
the current version, which is fine for me.
-- 
Jean-Baptiste Quenot
http://jbq.caraldi.com/

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.