Re: Cheetah's #include base directory

"R. Tyler Ballance" <[email protected]> Thu, 28 Jan 2010 16:53:58 -0800
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
On Thu, 28 Jan 2010, Aahz wrote:

> On Tue, Jan 26, 2010, R. Tyler Ballance wrote:
> > On Tue, 26 Jan 2010, Aahz wrote:
> >> 
> >> All right, how do you do create global template elements such as page
> >> footers?  I want to write them in Cheetah rather than Python because
> >> they're primarily HTML.
> > 
> > I use inheritance between pre-compiled templates (since it's tricky to do with
> > dynamic compilation), here's an example:
> > 
> > base.tmpl: http://github.com/rtyler/urlenco.de/blob/master/Urlencode/views/base.tmpl
> > index.tmpl: http://github.com/rtyler/urlenco.de/blob/master/Urlencode/views/index.tmpl
> 
> Ah-ha.  Well, since I *do* want dynamic compilation for development, I
> guess I'm going to need to put in some skill sweat to figure out how to
> make that work.

Indeed; I think adding the ability to use inheritance with dynamic compilation
would be a good feature to add to Cheetah but I'm uncertain on what the API
would look like?

Should I create fake modules for templates based on their paths? I.e. if your
base.tmpl was located in proj/views does it make sense that inheritors of that
base.tmpl would do:

    #from proj.views import base
    #extends base.base

For the dynamic compilation I think I'm going to have to fudge the modules to
make it work, i'm just worried about it being non-obvious to developers :/

Cheers,
-R. Tyler Ballance
--------------------------------------
 Jabber: [email protected]
 GitHub: http://github.com/rtyler
Twitter: http://twitter.com/agentdero
   Blog: http://unethicalblogger.com

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com

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

iEYEARECAAYFAktiMaQACgkQFCbH3D9R4W90gQCfaPtU0z3AulLqu/KVnLT0HVtL
c0sAn0CtjmbjeSt212vct/dRAFG4Hlh7
=g8lR
-----END PGP SIGNATURE-----