Re: #def woes

"R. Tyler Ballance" <[email protected]>
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
On Wed, May 20, 2009 at 04:16:38PM -0400, Michael Higgins wrote:
> #def foo($a)
> <b>$a</b>
> #end def
> 
> #set $faa = $getVar('foo', autoCall=False)
> $faa('hi')


I /think/ this should work:
	#set $faa = foo

Alternatively, you can use:
	#set $faa = $foo

If you compile the templates with autocalling disabled

> 
> 
> does what you want, I think.  I'm not sure if there's a more elegant  
> approach directly in Cheetah, though of course you could write a  
> convenience function so you don't have to type getVar blah blah blah  
> all the time if you need to do this a lot.
> 
> Mike
> 
> 
> 
> On May 20, 2009, at 4:03 PM, [email protected] wrote:
> 
> > oops forgot autocalling
> > so how do we give a function another name
> >
> > On Wed, May 20, 2009 at 10:36 AM, R. Tyler Ballance  
> > <[email protected]> wrote:
> > On Wed, May 20, 2009 at 03:46:57AM -0700, [email protected]  
> > wrote:
> > >    #def foo($a)
> > >    <b>$a</b>
> > >    #end def
> > >
> > >    #set faa = $foo
> > >    $faa()
> > >    this doesnt work?
> > >    why not
> >
> >
> > What do you expect this to do? Refer to the documentation for
> > "autocalling"
> >
> > >    --
> > >    Bidegg worlds best auction site
> > >    http://bidegg.com
> >
> > >  
> > ------------------------------------------------------------------------------
> > > Crystal Reports - New Free Runtime and 30 Day Trial
> > > Check out the new simplified licensing option that enables
> > > unlimited royalty-free distribution of the report engine
> > > for externally facing server and web deployment.
> > > http://p.sf.net/sfu/businessobjects
> > > _______________________________________________
> > > Cheetahtemplate-discuss mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
> >
> >
> > --
> > -R. Tyler Ballance
> > Slide, Inc.
> >
> >
> >
> > -- 
> > Bidegg worlds best auction site
> > http://bidegg.com
> > ------------------------------------------------------------------------------
> > Crystal Reports - New Free Runtime and 30 Day Trial
> > Check out the new simplified licensing option that enables
> > unlimited royalty-free distribution of the report engine
> > for externally facing server and web deployment.
> > http://p.sf.net/sfu/businessobjects_______________________________________________
> > Cheetahtemplate-discuss mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
> 
> 
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables 
> unlimited royalty-free distribution of the report engine 
> for externally facing server and web deployment. 
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Cheetahtemplate-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

-- 
-R. Tyler Ballance
Slide, Inc.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkoUZaoACgkQFCbH3D9R4W/WUQCeLZdLTTRiya6rbXRs0DE/J3Gn
CC8AoJ6zvDjfKmOkvWFNYVQlACnSDgbe
=8T3u
-----END PGP SIGNATURE-----
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.