Flask - store object directly in a session [duplicate]
A simple way to make your object serialize and achieve what you want is to use __dict__
like so:
def main(): session['my_object'] = Test(1, 2, 3).__dict__ return redirect('retrieve')
A simple way to make your object serialize and achieve what you want is to use __dict__
like so:
def main(): session['my_object'] = Test(1, 2, 3).__dict__ return redirect('retrieve')