aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/routers.py
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework/routers.py')
-rw-r--r--rest_framework/routers.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/rest_framework/routers.py b/rest_framework/routers.py
index 406ebcf7..ae56673d 100644
--- a/rest_framework/routers.py
+++ b/rest_framework/routers.py
@@ -128,6 +128,9 @@ class SimpleRouter(BaseRouter):
If `base_name` is not specified, attempt to automatically determine
it from the viewset.
"""
+ # Note that `.model` attribute on views is deprecated, although we
+ # enforce the deprecation on the view `get_serializer_class()` and
+ # `get_queryset()` methods, rather than here.
model_cls = getattr(viewset, 'model', None)
queryset = getattr(viewset, 'queryset', None)
if model_cls is None and queryset is not None:
@@ -135,7 +138,7 @@ class SimpleRouter(BaseRouter):
assert model_cls, '`base_name` argument not specified, and could ' \
'not automatically determine the name from the viewset, as ' \
- 'it does not have a `.model` or `.queryset` attribute.'
+ 'it does not have a `.queryset` attribute.'
return model_cls._meta.object_name.lower()