diff options
| author | Tim Graham <timograham@gmail.com> | 2012-11-22 09:07:21 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2012-11-22 09:07:21 -0500 |
| commit | 7b2d95eb3054e95d2fa4c36d8194cd74816118a7 (patch) | |
| tree | 4f68e67192c524a4ce7dafa30a26a57886da9866 /django | |
| parent | 3587991ba8d223fe9fe4d54a094b82dbc9c27bc2 (diff) | |
Clarified usage of as_view kwargs for setting arguments on class based views
Thanks Dave McLain for the patch.
Diffstat (limited to 'django')
| -rw-r--r-- | django/views/generic/base.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/views/generic/base.py b/django/views/generic/base.py index 23e18c54a0..d0045a2ef0 100644 --- a/django/views/generic/base.py +++ b/django/views/generic/base.py @@ -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) |
