aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/compat.py
diff options
context:
space:
mode:
authorPhilip Douglas2013-10-03 11:12:55 +0100
committerPhilip Douglas2013-10-03 11:12:55 +0100
commita2ae469f6ba6ed7e69e9c6a7741876ae14a36057 (patch)
tree399110e75bc1c3b2fbddd314526c3c17f9d68574 /rest_framework/compat.py
parente5da0ff5e530c8ea0e2cf4dff0723ede6234860e (diff)
parentc3175900bc0681965d07d85c8b9010534e0ff901 (diff)
downloaddjango-rest-framework-a2ae469f6ba6ed7e69e9c6a7741876ae14a36057.tar.bz2
Merge remote-tracking branch 'upstream/master'
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 b9d1dae6..581e29fc 100644
--- a/rest_framework/compat.py
+++ b/rest_framework/compat.py
@@ -80,6 +80,14 @@ except ImportError:
Image = None
+def get_model_name(model_cls):
+ try:
+ return model_cls._meta.model_name
+ except AttributeError:
+ # < 1.6 used module_name instead of model_name
+ return model_cls._meta.module_name
+
+
def get_concrete_model(model_cls):
try:
return model_cls._meta.concrete_model