[Flask] Setting global flag and keeping it in the session
jicenhower at yahoo.com
Thu Jul 23 14:57:30 CEST 2015
Hi,I'm a fairly new user of Python and Flask but I am a professional Java developer.
I have started creating an app using the Flask Appbuilder. I would like to set a value from the user's login record (accountId) when he logs in and have it be available for queries on future hits during his session. I know I could include a join to the user's record to get accountId with every query but it seems it might be more efficient to store accountId in the session and add it to the WHERE clause of any queries.
Also, it seems like handling session variables would be a good thing to know in general.
Can anyone give me a clue about how to store and retrieve session variables? I've seen the g object but I'm not sure how to use it or if that's the best way to do this. I'm actually not sure that the g object persists across hits.
Thanks for any help! Jim
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Flask