mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #14512 -- Added documentation on how to apply decorators to class-based generic views. Thanks to Łukasz Rekucki for his work on the issue.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14642 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,19 +1,12 @@
|
||||
import copy
|
||||
from django import http
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.template import RequestContext, loader
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.functional import update_wrapper
|
||||
from django.utils.log import getLogger
|
||||
from django.utils.decorators import classonlymethod
|
||||
|
||||
logger = getLogger('django.request')
|
||||
|
||||
class classonlymethod(classmethod):
|
||||
def __get__(self, instance, owner):
|
||||
if instance is not None:
|
||||
raise AttributeError("This method is available only on the view class.")
|
||||
return super(classonlymethod, self).__get__(instance, owner)
|
||||
|
||||
class View(object):
|
||||
"""
|
||||
Intentionally simple parent class for all views. Only implements
|
||||
|
||||
Reference in New Issue
Block a user