On Jan 7, 2009, at 4:59 AM, Paweł Stradomski wrote:

Just note, that in case the dict is not modified directly, but an object
inside is modified, you won't get notified of the change.

Eg. suppose the restored session has:
session['messages'] = []

Now i do:
session['messages'].append(u'New flash message')

You won't see that the session has changed.

This is the exact reason we don't have a 'dirty' type flag like this set on setitem. However, I think it'd be useful to let a user set the 'dirty' flag themselves, in addition to letting sessions auto-save merely upon access (just to be sure), or something as Tycon suggests. Many people end up calling save() multiple times because they need to put stuff in the session in various places and ensures its saved, when really, they should be marking it 'to-be-saved' so its done just *once*.

Tycon, I'll have some time later today to merge a patch to that effect in.

Cheers,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to