Hey tavis and Tyler
If you really *must* avoid first compiling foo.tmpl, then for now the
#include would be what you'd want. See:
http://www.cheetahtemplate.org/docs/users_guide_html/users_guide.html#SECTION000860000000000000000
*We cant compile templates in webpy and include is what we need*
*So please DONT PHASE OUT #includes*
*all our code base uses #include
*
On Tue, May 5, 2009 at 9:33 AM, R. Tyler Ballance <[email protected]> wrote:
> 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.
>
> What it sounds like you need is an addition to Cheetah I just released,
> proper @staticmethod and @classmethod support. Basically with
> @staticmethod support you would have syntax like this:
>
>
> dir1/dir2/dir3/foo.tmpl
> =================================
> #@staticmethod
> #def FooFunct($param1, $param2):
> #return ($param1, $param2)
> #end def
>
>
> dir1/base.tmpl
> =================================
> #from dir1.dir2.dir3 import foo
>
> $foo.FooFunct('omg', 'rly?')
>
>
>
> The import and calling syntaxes mirror that of Python static methods
> themselves in this case as well.
>
> You can find @staticmethod and @classmethod support in v2.1.2 which I'm
> preparing for release today (it's already been tagged)
> http://github.com/rtyler/cheetah/tarball/v2.1.2
>
>
> > I assume I need to import foo in some way but don't know where it
> > lives (I have tried from dir1.dir2.dir3 import foo already ;). Is
> > there a way of doing this without first compiling foo.tmpl?
>
> If you really *must* avoid first compiling foo.tmpl, then for now the
> #include would be what you'd want. See:
>
> http://www.cheetahtemplate.org/docs/users_guide_html/users_guide.html#SECTION000860000000000000000
>
>
> Cheers
> --
> -R. Tyler Ballance
> Slide, Inc.
>
>
> ------------------------------------------------------------------------------
> 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
> _______________________________________________
> Cheetahtemplate-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
>
>
--
Bidegg worlds best auction site
http://bidegg.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
_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
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.