aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/compat.py
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework/compat.py')
-rw-r--r--rest_framework/compat.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/rest_framework/compat.py b/rest_framework/compat.py
index 5fc6c686..7664c400 100644
--- a/rest_framework/compat.py
+++ b/rest_framework/compat.py
@@ -10,6 +10,14 @@ except ImportError:
import StringIO
+def get_concrete_model(model_cls):
+ try:
+ return model_cls._meta.concrete_model
+ except AttributeError:
+ # 1.3 does not include concrete model
+ return model_cls
+
+
# First implementation of Django class-based views did not include head method
# in base View class - https://code.djangoproject.com/ticket/15668
if django.VERSION >= (1, 4):