[Flask] Setting global flag and keeping it in the session
tamasiaina at gmail.com
Sat Jul 25 19:21:48 CEST 2015
A quick tutorial of sessions can be found in the documentation here:
to store information. The neat thing with the session object is that you
can interface it into another datastore like redis or mongo. The g object
is attached to the request so information or data that you put into the g
object does not persist between different requests while session object
On Thu, Jul 23, 2015 at 5:57 AM, Jim Icenhower via Flask <flask at python.org>
> I'm a fairly new user of Python and Flask but I am a professional Java
> 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!
> Flask mailing list
> Flask at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Flask