Fixed #1339 -- Added keys() and items() methods to session objects. Thanks, Ned Batchelder
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d8b4d29004
commit
bf16befc43
1
AUTHORS
1
AUTHORS
|
@ -36,6 +36,7 @@ answer newbie questions, and generally made Django that much better:
|
|||
David Ascher <http://ascher.ca/>
|
||||
Arthur <avandorp@gmail.com>
|
||||
Jiri Barton
|
||||
Ned Batchelder <http://www.nedbatchelder.com/>
|
||||
James Bennett
|
||||
Paul Bissex <http://e-scribe.com/>
|
||||
Simon Blanchard
|
||||
|
|
|
@ -25,6 +25,12 @@ class SessionWrapper(object):
|
|||
del self._session[key]
|
||||
self.modified = True
|
||||
|
||||
def keys(self):
|
||||
return self._session.keys()
|
||||
|
||||
def items(self):
|
||||
return self._session.items()
|
||||
|
||||
def get(self, key, default=None):
|
||||
return self._session.get(key, default)
|
||||
|
||||
|
|
|
@ -50,6 +50,12 @@ It implements the following standard dictionary methods:
|
|||
* ``get(key, default=None)``
|
||||
Example: ``fav_color = request.session.get('fav_color', 'red')``
|
||||
|
||||
* ``keys()``
|
||||
**New in Django development version.**
|
||||
|
||||
* ``items()``
|
||||
**New in Django development version.**
|
||||
|
||||
It also has these three methods:
|
||||
|
||||
* ``set_test_cookie()``
|
||||
|
|
Loading…
Reference in New Issue