我有以下简单的看法。有什么办法可以让它更有活力吗?
# ...
if 'folding' not in request.session:
request.session['folding'] = {'shop':False,'users':False,'chat':False}
# ...
def update_folding_view(request,category,is_folded):
if request.is_ajax():
folding = request.session['folding']
if 'shop' in category:
folding.shop = is_folded
if 'users' in category:
folding.users = is_folded
if 'chat' in category:
folding.chat = is_folded
request.session['folding'] = folding
else:
raise Http404