Iterating over objects in temp_folder/session_data
Hi all, I'd like to iterate over all transient objects and SESSION variables held in those transient objects on our server. That is all the transient objects held in temp_folder/session_data. Ideally I'd like to be able to access the variables in the same way that we access then now, ie <dtml-var "REQUEST['SESSION']['username']"> except it wouldn¹t happen that way would it :) Any snippets around to show how to do this? TIA for any pointers Tone. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
See the help system. The interface for the TransientObjectContainer is the interface for the temp_folder/session_data object. It also supports the (undocumented) items, values, and keys methods, which act just like the dictionary methods of the same name. The keys are the browser ids and the values are the session objects. This has not been exposed in the interface because the data container was never meant to be used this way, but you can do so (caveat emptor). On Mon, 2002-11-25 at 09:57, Tony McDonald wrote:
Hi all, I'd like to iterate over all transient objects and SESSION variables held in those transient objects on our server. That is all the transient objects held in temp_folder/session_data.
Ideally I'd like to be able to access the variables in the same way that we access then now, ie <dtml-var "REQUEST['SESSION']['username']"> except it wouldn¹t happen that way would it :)
Any snippets around to show how to do this?
TIA for any pointers Tone. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On 25/11/02 6:12 pm, "Chris McDonough" <chrism@zope.com> wrote:
See the help system.
Ahhh.. yes - should have dug into it in more detail I guess (spent my time digging around in the source and missed it).
The interface for the TransientObjectContainer is the interface for the temp_folder/session_data object.
Yup. For those looking around, it's Help, Zope Help, API reference, Transient Objects.
It also supports the (undocumented) items, values, and keys methods, which act just like the dictionary methods of the same name. The keys are the browser ids and the values are the session objects.
Great Chris, many thanks. With that I should be able to dig around a bit and see what comes up.
This has not been exposed in the interface because the data container was never meant to be used this way, but you can do so (caveat emptor).
It's ok, I've had my shots! Many thanks. Tone. -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
On Tuesday 26 November 2002 18:11, Tony McDonald wrote:
On 25/11/02 6:12 pm, "Chris McDonough" <chrism@zope.com> wrote:
See the help system.
Ahhh.. yes - should have dug into it in more detail I guess (spent my time digging around in the source and missed it).
The interface for the TransientObjectContainer is the interface for the temp_folder/session_data object.
Yup. For those looking around, it's Help, Zope Help, API reference, Transient Objects.
It also supports the (undocumented) items, values, and keys methods, which act just like the dictionary methods of the same name. The keys are the browser ids and the values are the session objects.
Great Chris, many thanks. With that I should be able to dig around a bit and see what comes up.
This has not been exposed in the interface because the data container was never meant to be used this way, but you can do so (caveat emptor).
It's ok, I've had my shots!
Many thanks. Tone.
i've had bad luck with iterating temp_folder/session_data and session i got key errors that can only be rectified only by changing something in session-data, or resetting zope. it's probably me more than zope. so, please tell me if you got better luck :P http://zope.nipltd.com/public/lists/zope-archive.nsf/Main/D120D8D0B1CC81C380256C4800238D47?OpenDocument&mode=subject&topic=[Zope]sessionanditeratingsession_data http://zope.nipltd.com/public/lists/zope-archive.nsf/ByKey/EE5D11EB492DADF7 -- http://www.kedai.com.my/ http://www.kedai.com.my/eZine http://www.zope.org/Members/kedai http://www.my-zope.org Am I Evil?
Tony McDonald writes:
I'd like to iterate over all transient objects and SESSION variables held in those transient objects on our server. That is all the transient objects held in temp_folder/session_data. I expect, "session_data" will expose a (protected) mapping API with methods "keys", "values" and "items".
You will almost surely need an External Method or file system based product to use this API (at least I hope so). Dieter
On 25/11/02 6:34 pm, "Dieter Maurer" <dieter@handshake.de> wrote:
Tony McDonald writes:
I'd like to iterate over all transient objects and SESSION variables held in those transient objects on our server. That is all the transient objects held in temp_folder/session_data. I expect, "session_data" will expose a (protected) mapping API with methods "keys", "values" and "items".
You will almost surely need an External Method or file system based product to use this API (at least I hope so).
Dieter
Thanks for the hint Dieter, Chris pointed out the right interface to use, and I'll start digging around with an External Method into the session_data object. tone -- Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/ The Medical School, Newcastle University Tel: +44 191 243 6140 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
participants (4)
-
Bakhtiar A Hamid -
Chris McDonough -
Dieter Maurer -
Tony McDonald