[albatross-users] Wiki example and related extension: iterate over ctx/session

Gregory Bond gnb at itga.com.au
Mon Jul 7 18:20:01 EST 2003


> Is it possible to do the same for the session variables?

Not in standard Albatross.  The list of names in the session is stored in a
dict called ctx.__vars and that's not available to templates.  Can't get access
to it from the python code due to funky '__<>' handling, too.  Need to fix 
this in the SessionBase class.

Perhaps the SessionBase ctor could do:
	self.locals.__session__ = self.__vars
so your templates could do
	<ul><al-for iter="k" expr="__session__.keys()">
		<li><al-value expr="k.value()"/></li>
	</al-for></ul>







More information about the Albatross-users mailing list