[Zope] Session Variable Error

Asad Habib ahabib at engin.umich.edu
Thu Apr 28 14:26:25 EDT 2005


Andreas, you misunderstood me. What I said is that #1 does not work but
#2 does.

#1. <dtml-call "REQUEST.SESSION.set('undergraduateProjectsDirected', [])">

#2. <dtml-call "REQUEST.SESSION.set('undergradProjectsDirected', [ ])">

- Asad


On Thu, 28 Apr 2005, Andreas Jung wrote:

>
> You said you set the variable through:
>
> <dtml-call "REQUEST.SESSION.set('undergradProjectsDirected', [ ])">
>
>
> You wrote that this does not work:
>
> <dtml-call
> "(REQUEST.SESSION.get('undergraduateProjectsDirected')).append([student_name,
> description])">
>
> Of course it does not work because in both cases the names of the session
> vars are completely different..
> so why should this work?
>
> -aj
>
>
>
> --On Donnerstag, 28. April 2005 13:56 Uhr -0400 Asad Habib
> <ahabib at engin.umich.edu> wrote:
>
> > Actually, it does exist as I mentioned in my original message. If it did
> > not exist, then <dtml-var "REQUEST.SESSION"> would yield a value of None
> > for it. Also, if this were the case, then simply changing the name of the
> > variable would not solve the problem.
> >
> > - Asad
> >
> >
> > On Thu, 28 Apr 2005, Andreas Jung wrote:
> >
> >>
> >>
> >> --On Donnerstag, 28. April 2005 13:44 Uhr -0400 Asad Habib
> >> <ahabib at engin.umich.edu> wrote:
> >>
> >> > I have a session variable called 'undergraduateProjectsDirected' that I
> >> > declare using the following syntax:
> >> >
> >> > <dtml-call "REQUEST.SESSION.set('undergradProjectsDirected', [ ])">
> >> >
> >> > When I try to append items to this list variable, I get the following
> >> > error:
> >> >
> >> > AttributeError: 'NoneType' object has no attribute 'append'
> >> >
> >> > I know for a fact that this variable exists since flushing the SESSION
> >> > attribute of the REQUEST variable using <dtml-var "REQUEST.SESSION">
> >> > yields its name and shows that it is initially empty.
> >> >
> >> > I am using the following statement to append items:
> >> >
> >> > <dtml-call
> >> > "(REQUEST.SESSION.get('undergraduateProjectsDirected')).append([studen
> >> > t_n ame, description])">
> >> >
> >> > The strange thing is that when I change the name of this variable to
> >> > 'undergradProjectsDirected', the error does not occur anymore.
> >>
> >> Check the spelling of your session key! Of course you're getting an
> >> error when you are trying to append to something that does not exist.
> >>
> >> -aj
> >>
> >>
>
>
>
>


More information about the Zope mailing list