Re: [Zope] Session Variable Error
Andreas, you misunderstood me. What I said is that #1 does not work but #2 does. #1. #2. - Asad On Thu, 28 Apr 2005, Andreas Jung wrote: > > You said you set the variable through: > > > > > You wrote that this does not work: > > "(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 > <[EMAIL PROTECTED]> wrote: > > > Actually, it does exist as I mentioned in my original message. If it did > > not exist, then 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 > >> <[EMAIL PROTECTED]> wrote: > >> > >> > I have a session variable called 'undergraduateProjectsDirected' that I > >> > declare using the following syntax: > >> > > >> > > >> > > >> > 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 > >> > yields its name and shows that it is initially empty. > >> > > >> > I am using the following statement to append items: > >> > > >> > >> > "(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 > >> > >> > > > > ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Session Variable Error
Asad Habib wrote: Actually, it does exist as I mentioned in my original message. If it did not exist, then 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. I think that Andreas is pointing out an inconsistency in your original post, and you should check and make sure that the inconsistency does not actually exist in your program. First you indicate that you set a variable called "undergradProjectsDirected": I declare using the following syntax: But then you indicate that you are using the following to add items: I am using the following statement to append items: Notice that this time you are using "undergraduateProjectsDirected". Please check and then indicate whether this is true in your actual program. Obviously, if you are goign to change the name of the variable, you have to be consistent. Andreas is just indicating that perhaps you haven't been careful to ensure this. HTH, JZ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Session Variable Error
You said you set the variable through: You wrote that this does not work: 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 <[EMAIL PROTECTED]> wrote: Actually, it does exist as I mentioned in my original message. If it did not exist, then 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 <[EMAIL PROTECTED]> wrote: > I have a session variable called 'undergraduateProjectsDirected' that I > declare using the following syntax: > > > > 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 > yields its name and shows that it is initially empty. > > I am using the following statement to append items: > > "(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 pgp30x1ZT9Eo3.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Session Variable Error
On Thu, 28 Apr 2005, Asad Habib wrote: > I have a session variable called 'undergraduateProjectsDirected' that I > declare using the following syntax: > > > > 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 > yields its name and shows that it is initially empty. > > I am using the following statement to append items: > > "(REQUEST.SESSION.get('undergraduateProjectsDirected')).append([student_name, > description])"> > > The strange thing is that when I change the name of this variable to > 'undergradProjectsDirected', the error does not occur anymore. Once you get beyond this problem, you may want to think about persistence issues. See The Zope Book for details. The list probably should be an instance of a PersistentList and you should use the copy-out/copy-in technique described in the API and in the Developers Guide. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Session Variable Error
Actually, it does exist as I mentioned in my original message. If it did not exist, then 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 > <[EMAIL PROTECTED]> wrote: > > > I have a session variable called 'undergraduateProjectsDirected' that I > > declare using the following syntax: > > > > > > > > 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 > > yields its name and shows that it is initially empty. > > > > I am using the following statement to append items: > > > > > "(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 > > ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Session Variable Error
--On Donnerstag, 28. April 2005 13:44 Uhr -0400 Asad Habib <[EMAIL PROTECTED]> wrote: I have a session variable called 'undergraduateProjectsDirected' that I declare using the following syntax: 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 yields its name and shows that it is initially empty. I am using the following statement to append items: 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 pgpdwVXdEAQZ1.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Session Variable Error
I have a session variable called 'undergraduateProjectsDirected' that I declare using the following syntax: 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 yields its name and shows that it is initially empty. I am using the following statement to append items: The strange thing is that when I change the name of this variable to 'undergradProjectsDirected', the error does not occur anymore. Has anyone experienced something similar? I think a variable with the same name exists (perhaps I created one in another one of my intranet applications) and Zope is referring to the old copy instead of the newly created one. I tried flushing the transient object container as well but it did not make a difference. Any help would be greatly appreciated. Thank you. - Asad ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )