On Mar 24, 2011, at 9:39 AM, Rui Gomes wrote:
> Regarding storing the class in the session is not a problem that work fine 
> for me(need to be careful some things can't be pickel), the problem is 
> re-write it at each call,
> 
> I already try something similar to 
> 
> order = session.order or Order()
> 
> I did,
> 
> if not isinstance("session.order",Order):
>     session.order=Order()
> 
> that didnt work session.order look always like empty to the validation, since 
> a python module just get imported once, if I move the class out of the models 
> in the web2py and put it in a file and imported something 

A web2py model gets run on every request, so something like this should work OK 
(I think). Is it possible that session.order is there, but not recognized as 
Order? What happens if you test for: session.order is None?

> 
> from Order import *
> 
> Maybe thats work.
> 
> Any other ideas how to do this?
> 
> 
> BTW: Thanks for the help if in the mean while i figure this one out I will 
> post it here.
> 


Reply via email to