1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Clarified usage of as_view kwargs for setting arguments on class based views

Thanks Dave McLain for the patch.
This commit is contained in:
Tim Graham
2012-11-22 09:07:21 -05:00
parent 3587991ba8
commit 7b2d95eb30
2 changed files with 6 additions and 4 deletions

View File

@@ -54,8 +54,9 @@ class View(object):
"keyword argument to %s(). Don't do that."
% (key, cls.__name__))
if not hasattr(cls, key):
raise TypeError("%s() received an invalid keyword %r" % (
cls.__name__, key))
raise TypeError("%s() received an invalid keyword %r. as_view "
"only accepts arguments that are already "
"attributes of the class." % (cls.__name__, key))
def view(request, *args, **kwargs):
self = cls(**initkwargs)