[albatross-users] load_template vs run_template, macros vs lookups

Gregory Bond gnb at itga.com.au
Mon Dec 16 12:14:35 EST 2002


> In your case, you're defining a lookup after you're using it. 

Hmm, I don't think so.  At least, I'm not deliberately doing this!

My App class does this:

    def create_context(self):
        ctx = AppContext(self)
	ctx.load_template('header.html')	
	return ctx

'header.html' contains a bunch of <al-macro> definitions, and some <al-lookup>
 definitions.  So the macros and lookups should be defined before more-or-less
anything else happens.

Then in the page_display, I run_template() a file that uses these macros and 
lookups.   The macros work, the lookups don't.

If I change the create_context() to do
	ctx.run_template('header.html')
then both the macros and lookups work.  This is (cough) non-intuitive.






More information about the Albatross-users mailing list