Found a workaround to this:
1st view:
baos=ByteArrayOutputStream() #make an outputstream
cred.save(baos) #store the credential to the outputstream
request.session['user_cred']=baos.toString() #store the string
2nd view:
outstring=String(request.session['user_cred']) #get the string
bais=ByteArray
On Fri, Oct 7, 2011 at 11:41 AM, django-jython-user wrote:
> Hi,
> I'm having trouble using django sessions objects.
>
> so I set the object in one view:
> request.session['user_cred']=cred #where cred is a GlobusCredential
the session object does automatic pickling of object to store them.
but t
"Do you get that in the view where you just inserted it into the session?"
No, this was from the 2nd view, where I wanted to access the session object
On Fri, Oct 7, 2011 at 1:10 PM, Shawn Milochik wrote:
> On Fri, Oct 7, 2011 at 1:07 PM, Saba Bokhari wrote:
>
>> I thought it was something lik
On Fri, Oct 7, 2011 at 1:07 PM, Saba Bokhari wrote:
> I thought it was something like that, but when I do:
>
> a_cred=request.session['user_cred']
> print type(a_cred)
>
> I get this result:
>
> not unicode
>
>
Do you get that in the view where you just inserted it into the session?
What do yo
I thought it was something like that, but when I do:
a_cred=request.session['user_cred']
print type(a_cred)
I get this result:
not unicode
On Fri, Oct 7, 2011 at 1:00 PM, Shawn Milochik wrote:
> Session variables are strings.
>
> If you want an object you're going to have to serialize it (pro
Session variables are strings.
If you want an object you're going to have to serialize it (probably using
pickle) and deserialize it when you retrieve it before you can use it.
As you're doing it now, you're probably just storing the unicode
representation in the session, not the actual object.
Hi,
I'm having trouble using django sessions objects.
so I set the object in one view:
request.session['user_cred']=cred #where cred is a GlobusCredential
I access the object in another view:
a_cred=request.session['user_cred']
# but if I use a_cred like
a_id=a_cred.getIdentity()
I get this erro
7 matches
Mail list logo