From 4d8c63abc996bcb44d7a68dd7a7234b0d9f148a0 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 20 Aug 2014 17:15:46 +0100 Subject: Deprecate .model in related routers/permissions --- rest_framework/permissions.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rest_framework/permissions.py') diff --git a/rest_framework/permissions.py b/rest_framework/permissions.py index 6a1a0077..29f60d6d 100644 --- a/rest_framework/permissions.py +++ b/rest_framework/permissions.py @@ -108,6 +108,9 @@ class DjangoModelPermissions(BasePermission): return [perm % kwargs for perm in self.perms_map[method]] def has_permission(self, request, view): + # 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(view, 'model', None) queryset = getattr(view, 'queryset', None) -- cgit v1.2.3