Added 'Session object guidlines' section to docs/sessions.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@524 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
21c4526557
commit
99d8bb34fe
|
@ -63,6 +63,18 @@ It also has these two methods:
|
||||||
You can edit ``request.session`` at any point in your view. You can edit it
|
You can edit ``request.session`` at any point in your view. You can edit it
|
||||||
multiple times.
|
multiple times.
|
||||||
|
|
||||||
|
Session object guidelines
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
* Use normal Python strings as dictionary keys on ``request.session``. This
|
||||||
|
is more of a convention than a hard-and-fast rule.
|
||||||
|
|
||||||
|
* Session dictionary keys that begin with an underscore are reserved for
|
||||||
|
internal use by Django.
|
||||||
|
|
||||||
|
* Don't override ``request.session`` with a new object, and don't access or
|
||||||
|
set its attributes. Use it like a Python dictionary.
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue