Anthony,

I maybe wrong, but I am not sure I understand correctly your example
here... Or maybe you suggest this for an other reason... But to me you want
to refresh cash when the form is submit and the value change (since what I
am caching is a dict of id and reprensetnation)... I think it make more
sens like this :

expire = 3600 if not request.post_vars else 0

??

Thanks

Richard


On Thu, Sep 27, 2012 at 2:15 PM, Anthony <[email protected]> wrote:

> var_name = cache.ram('var_name',  **lambda: do_something, time_expire=**
>> 3600)
>>
>> You can then clear the cache like this :
>>
>> cache.ram.clear(var_name)
>>
>
> You can also do:
>
> expire = 3600 if request.post_vars else 0
> var_name = cache.ram('var_name', lambda: do_something, time_expire=expire)
>
> So, when the form is created, time_expire will be 0, which forces the
> value to be refreshed.
>
> Anthony
>
>  --
>
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to