[albatross-users] Two more issues

Michael C. Neel neel at mediapulse.com
Fri Dec 6 05:25:28 EST 2002


> Michael> 2.)  Al-if (and maybe other tags, I haven't tested) do not
> Michael> "see" session varaibles.  For example if I have state as a
> Michael> session var, it will be displayed correctly on an al-input
> Michael> name="state" tage, but al-if expr="state == 'TN'" will error
> Michael> with no var names state.
> 
> Hmm...  Does this mean that you are doing something like this:
>     ctx.add_session_vars('blah')
> 
> Without doing this:
>     ctx.locals.blah = 42
> 
> If that is the case, Andrew and I have decided that it might make
> sense to make the add_session_vars() method create a ctx.locals value
> and set it to None if it does not currently exist in ctx.locals
> 

What I have is I start off with the add_session_vars('blah'), then of
the first form, I have an input name="blah", which I make sure has a
value then I send the user form2.  On form2 I have an if "blah
=='value'" which works fine on the first run, but should that form2 be
displayed a second time I will get the error.  I was able to work around
this by add an input type="hidden" name="blah" to form2 so that blah was
always "submitted".

The above of adding a locals to set to None if it does not exist would
save me on a lot of redundant code; I'd only need to explictly state a
local if it was a list ( = [] ) or something simaliar.

Mike



More information about the Albatross-users mailing list