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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user