Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored
1  AUTHORS
@@ -36,6 +36,7 @@ answer newbie questions, and generally made Django that much better:
36 36
     David Ascher <http://ascher.ca/>
37 37
     Arthur <avandorp@gmail.com>
38 38
     Jiri Barton
  39
+    Ned Batchelder <http://www.nedbatchelder.com/>
39 40
     James Bennett
40 41
     Paul Bissex <http://e-scribe.com/>
41 42
     Simon Blanchard
6  django/middleware/sessions.py
@@ -25,6 +25,12 @@ def __delitem__(self, key):
25 25
         del self._session[key]
26 26
         self.modified = True
27 27
 
  28
+    def keys(self):
  29
+        return self._session.keys()
  30
+
  31
+    def items(self):
  32
+        return self._session.items()
  33
+
28 34
     def get(self, key, default=None):
29 35
         return self._session.get(key, default)
30 36
 
6  docs/sessions.txt
@@ -50,6 +50,12 @@ It implements the following standard dictionary methods:
50 50
     * ``get(key, default=None)``
51 51
       Example: ``fav_color = request.session.get('fav_color', 'red')``
52 52
 
  53
+    * ``keys()``
  54
+      **New in Django development version.**
  55
+
  56
+    * ``items()``
  57
+      **New in Django development version.**
  58
+
53 59
 It also has these three methods:
54 60
 
55 61
     * ``set_test_cookie()``

0 notes on commit bf16bef

Please sign in to comment.
Something went wrong with that request. Please try again.