[albatross-users] Two more issues

Michael C. Neel neel at mediapulse.com
Fri Dec 6 06:24:35 EST 2002


Okay, I see what you meant.  No, in the page_enter I did not initialize
"blah", I only called ctx.add_session_vars("blah"), it was set though a
form field and this doesn't appear to get the variable added to the
session.

It would be nice if this worked, but I can see the issue if blah was
expected to be a dict or a list and was set to None instead of [] or {}.
Still, I have a very large for with several fields that need to be in
the session, and there is a lot of blah = blah1 = blah2 = None code in
my page_enter, so I guess the lessor evil would be defaulting to none as
you suggest, and I'll handle lists/dicts/objects myself.

Thanks for all the help,
Mike

> -----Original Message-----
> From: Michael C. Neel 
> Sent: Thursday, December 05, 2002 1:25 PM
> To: Dave Cole
> Cc: albatross-users at object-craft.com.au
> Subject: RE: [albatross-users] Two more issues
> 
> 
> > 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
> _______________________________________________
> Albatross-users mailing list
> Albatross-users at object-craft.com.au
> https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albat
ross-users



More information about the Albatross-users mailing list