On 24 mar, 11:04, NewBeen <[email protected]> wrote:
> Hello guys,
>
> I have this class in a model,
>
> Class Order:
>
>     def __init__(self):
>         self.basket={"product":{},"quantity":{}}
>
>    def addProduct(self, Item):
>        self.basket["product"]["name"]=item["name"]
>
> session.order=Order()
>
> So far so good, but when I execute this, the class is always been
> initialize, so I lose my basket between pages...
> Any ideas how can I fix this, if I put a class in a module and import
> it will it fix it?
>
> Regards
> Rui Gomes

Hi,

You should use cache.

order = cache.ram('order', lambda:Order(), 3600)

Reply via email to