Changeset 2301
- Timestamp:
- 02/10/06 15:35:29 (3 years ago)
- Files:
-
- django/branches/magic-removal/AUTHORS (modified) (1 diff)
- django/branches/magic-removal/django/contrib/sessions/middleware.py (modified) (1 diff)
- django/branches/magic-removal/django/core/validators.py (modified) (1 diff)
- django/branches/magic-removal/docs/authentication.txt (modified) (1 diff)
- django/branches/magic-removal/docs/sessions.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/AUTHORS
r2296 r2301 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/> django/branches/magic-removal/django/contrib/sessions/middleware.py
r2211 r2301 25 25 del self._session[key] 26 26 self.modified = True 27 28 def keys(self): 29 return self._session.keys() 30 31 def items(self): 32 return self._session.items() 27 33 28 34 def get(self, key, default=None): django/branches/magic-removal/django/core/validators.py
r2137 r2301 27 27 phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE) 28 28 slug_re = re.compile(r'^[-\w]+$') 29 url_re = re.compile(r'^http ://\S+$')29 url_re = re.compile(r'^https?://\S+$') 30 30 31 31 lazy_inter = lazy(lambda a,b: str(a) % b, str) django/branches/magic-removal/docs/authentication.txt
r1951 r2301 229 229 .. _session documentation: http://www.djangoproject.com/documentation/sessions/ 230 230 231 How to log a user in 232 -------------------- 233 234 To log a user in, do the following within a view:: 235 236 from django.models.auth import users 237 request.session[users.SESSION_KEY] = some_user.id 238 239 Because this uses sessions, you'll need to make sure you have 240 ``SessionMiddleware`` enabled. See the `session documentation`_ for more 241 information. 242 243 This assumes ``some_user`` is your ``User`` instance. Depending on your task, 244 you'll probably want to make sure to validate the user's username and password. 245 231 246 Limiting access to logged-in users 232 247 ---------------------------------- django/branches/magic-removal/docs/sessions.txt
r1904 r2301 45 45 * ``get(key, default=None)`` 46 46 Example: ``fav_color = request.session.get('fav_color', 'red')`` 47 48 * ``keys()`` 49 **New in Django development version.** 50 51 * ``items()`` 52 **New in Django development version.** 47 53 48 54 It also has these three methods:
