📜  如何在 django 会话中存储列表 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:00.628000             🧑  作者: Mango

代码示例1
if not 'saved' in request.session or not request.session['saved']:
        request.session['saved'] = [obj]
    else:
        saved_list = request.session['saved']
        saved_list.append(obj)
        request.session['saved'] = saved_list