Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #1339 -- Added keys() and items() methods to session objects. T…

…hanks, Ned Batchelder

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit bf16befc433ff9e1764db0fa57ef05b507eee0e0 1 parent d8b4d29
Adrian Holovaty adrianholovaty authored
Showing with 13 additions and 0 deletions.
  1. +1 −0  AUTHORS
  2. +6 −0 django/middleware/sessions.py
  3. +6 −0 docs/sessions.txt
1  AUTHORS
View
@@ -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
6 django/middleware/sessions.py
View
@@ -25,6 +25,12 @@ def __delitem__(self, key):
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)
6 docs/sessions.txt
View
@@ -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()``
Please sign in to comment.
Something went wrong with that request. Please try again.