[Zope] CoreSessionTracking - looping over items
Chris McDonough
chrism@digicool.com
Mon, 23 Jul 2001 14:14:35 -0400
Please try to keep correspondence on the list.
THis can't be done from DTML if you're using an internal session data
container because DTML can't access attributes with a leading underscore.
Either use an external session data container or use an external method.
For instance, here's an external method that returns the number of session
data objects in the internal session data container, along with some DTML
that calls it.
def numberOfDataObjects(session_data_manager):
return len(session_data_manager._sdc)
<dtml-var "numberOfDataObjects(session_data_manager)">
HTH,
- C
----- Original Message -----
From: "Pawel Lewicki" <lewicki@provider.pl>
To: "Chris McDonough" <chrism@digicool.com>
Sent: Monday, July 23, 2001 1:58 PM
Subject: Re: [Zope] CoreSessionTracking - looping over items
>
> > You can loop over the session data object in a session data container.
> The
> > session data container uses the Python mapping interface.
> >
> > There is an "internal" session data container if you're using the
default
> > RAM-based sessioning. It is the _sdc attribute of the session data
> manager.
> > An external session data container is of course its own manageable Zope
> > object.
> >
> > See the SessioningInterfaces.py file for the interfaces associated with
a
> > session data container.
>
> Hallo,
> Thanks a lot for your answer. I don't know if I don't understand some
simple
> thing or it is a little bit more complicated. How to access sessions data?
> Would you give the simplest piece of dtml? I tried all variations of
> <dtml-in "SessionDataManager.sdc"> with and without ",_,'. How to access
> session objects from dtml? Of course I use the name of instance of
> SessionDataManager.
> Best regards,
>
> Pawel
>
>