[Zope] Session Variable Error
Andreas Jung
lists at andreas-jung.com
Thu Apr 28 13:49:18 EDT 2005
--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([student_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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050428/326c92c1/attachment.bin
More information about the Zope
mailing list