Django

Code

Changeset 2301

Show
Ignore:
Timestamp:
02/10/06 15:35:29 (3 years ago)
Author:
adrian
Message:

magic-removal: Merged to [2300]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/magic-removal/AUTHORS

    r2296 r2301  
    3737    Arthur <avandorp@gmail.com> 
    3838    Jiri Barton 
     39    Ned Batchelder <http://www.nedbatchelder.com/> 
    3940    James Bennett 
    4041    Paul Bissex <http://e-scribe.com/> 
  • django/branches/magic-removal/django/contrib/sessions/middleware.py

    r2211 r2301  
    2525        del self._session[key] 
    2626        self.modified = True 
     27 
     28    def keys(self): 
     29        return self._session.keys() 
     30 
     31    def items(self): 
     32        return self._session.items() 
    2733 
    2834    def get(self, key, default=None): 
  • django/branches/magic-removal/django/core/validators.py

    r2137 r2301  
    2727phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE) 
    2828slug_re = re.compile(r'^[-\w]+$') 
    29 url_re = re.compile(r'^http://\S+$') 
     29url_re = re.compile(r'^https?://\S+$') 
    3030 
    3131lazy_inter = lazy(lambda a,b: str(a) % b, str) 
  • django/branches/magic-removal/docs/authentication.txt

    r1951 r2301  
    229229.. _session documentation: http://www.djangoproject.com/documentation/sessions/ 
    230230 
     231How to log a user in 
     232-------------------- 
     233 
     234To 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 
     239Because this uses sessions, you'll need to make sure you have 
     240``SessionMiddleware`` enabled. See the `session documentation`_ for more 
     241information. 
     242 
     243This assumes ``some_user`` is your ``User`` instance. Depending on your task, 
     244you'll probably want to make sure to validate the user's username and password. 
     245 
    231246Limiting access to logged-in users 
    232247---------------------------------- 
  • django/branches/magic-removal/docs/sessions.txt

    r1904 r2301  
    4545    * ``get(key, default=None)`` 
    4646      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.** 
    4753 
    4854It also has these three methods: