1
0
mirror of https://github.com/django/django.git synced 2025-06-08 04:59:13 +00:00

magic-removal: Moved django.views.decorators.auth.* to django.contrib.auth.decorators

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans 2006-03-07 02:11:54 +00:00
parent 0ec5a547c9
commit cad2fa4e8b
4 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@ from django.shortcuts import render_to_response
from django.template import RequestContext from django.template import RequestContext
from django.http import Http404 from django.http import Http404
from django.models.comments import comments, moderatordeletions, userflags from django.models.comments import comments, moderatordeletions, userflags
from django.views.decorators.auth import login_required from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.conf import settings from django.conf import settings

View File

@ -4,7 +4,7 @@ from django.shortcuts import render_to_response
from django.template import Context, RequestContext, loader from django.template import Context, RequestContext, loader
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
from django.views.decorators.auth import login_required from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
class PasswordResetForm(forms.Manipulator): class PasswordResetForm(forms.Manipulator):

View File

@ -271,7 +271,7 @@ The login_required decorator
As a shortcut, you can use the convenient ``login_required`` decorator:: As a shortcut, you can use the convenient ``login_required`` decorator::
from django.views.decorators.auth import login_required from django.contrib.auth.decorators import login_required
def my_view(request): def my_view(request):
# ... # ...
@ -279,7 +279,7 @@ As a shortcut, you can use the convenient ``login_required`` decorator::
Here's the same thing, using Python 2.4's decorator syntax:: Here's the same thing, using Python 2.4's decorator syntax::
from django.views.decorators.auth import login_required from django.contrib.auth.decorators import login_required
@login_required @login_required
def my_view(request): def my_view(request):
@ -310,7 +310,7 @@ permission ``polls.can_vote``::
As a shortcut, you can use the convenient ``user_passes_test`` decorator:: As a shortcut, you can use the convenient ``user_passes_test`` decorator::
from django.views.decorators.auth import user_passes_test from django.contrib.auth.decorators import user_passes_test
def my_view(request): def my_view(request):
# ... # ...
@ -318,7 +318,7 @@ As a shortcut, you can use the convenient ``user_passes_test`` decorator::
Here's the same thing, using Python 2.4's decorator syntax:: Here's the same thing, using Python 2.4's decorator syntax::
from django.views.decorators.auth import user_passes_test from django.contrib.auth.decorators import user_passes_test
@user_passes_test(lambda u: u.has_perm('polls.can_vote')) @user_passes_test(lambda u: u.has_perm('polls.can_vote'))
def my_view(request): def my_view(request):
@ -334,7 +334,7 @@ specify the URL for your login page (``/accounts/login/`` by default).
Example in Python 2.3 syntax:: Example in Python 2.3 syntax::
from django.views.decorators.auth import user_passes_test from django.contrib.auth.decorators import user_passes_test
def my_view(request): def my_view(request):
# ... # ...
@ -342,7 +342,7 @@ Example in Python 2.3 syntax::
Example in Python 2.4 syntax:: Example in Python 2.4 syntax::
from django.views.decorators.auth import user_passes_test from django.contrib.auth.decorators import user_passes_test
@user_passes_test(lambda u: u.has_perm('polls.can_vote'), login_url='/login/') @user_passes_test(lambda u: u.has_perm('polls.can_vote'), login_url='/login/')
def my_view(request): def my_view(request):