How to store django objects as session variables ( object is not JSON serializable)?

前端 未结 6 1253
独厮守ぢ
独厮守ぢ 2021-02-13 17:58

I have a simple view

def foo(request):
   card = Card.objects.latest(datetime)
   request.session[\'card\']=card

For the above code I get the

6条回答
  •  孤街浪徒
    2021-02-13 18:27

    @Martijn is or might be the correct way to save the object in session variables.

    But the issue was solved by moving back to Django 1.5. So this issue is specifically for django 1.6.2.

    Hope this helps.

提交回复
热议问题