Thinking outloud....

Frans Haarman frans at haarman.com
Wed Dec 11 08:33:47 EST 2002


Greetings,

For a school project I am building a intranet site with mod_python & 
postresql. Dreaming about how cool the site could be I thought about 
using templates. We will probably not do it but it got me thinking.

What if one would save the location off variables in the files and
the next time you open the template, simply replace those variables
instantly instead off parsing the whole template to find out where
the variables should be replaced.

* Read in file
* Find out what data should be replaced. Lets say we have 2 values in 
the templated identified with ::FIRSTNAME:: ::LASTNAME::
* saving the names and location off ::FIRSTNAME:: ::LASTNAME::
* write a new template file with location and name information
* next time the template gets called the new file will be used, so we 
dont have to parse the whole template again


Seemed like a neat idea and I was wondering if something like this would 
be usefull and a performance gain.

Oh, anybody using python for templates ? Tips for good modules ?

Thanks,

Frans




More information about the Python-list mailing list