Changes between Version 50 and Version 51 of NewbieMistakes


Ignore:
Timestamp:
May 17, 2013, 12:47:24 PM (11 years ago)
Author:
John Borwick <john_borwick@…>
Comment:

In-place appending works OK if you tell Django the session was modified

Legend:

Unmodified
Added
Removed
Modified
  • NewbieMistakes

    v50 v51  
    107107sessionlist.append(new_object)
    108108request.session['my_list'] = sessionlist
     109}}}
     110
     111Alternatively, explictly mark the session as modified:
     112
     113{{{
     114request.session['my_list'].append(new_object)
     115request.session.modified = True
    109116}}}
    110117
Back to Top