diff options
| author | Tom Christie | 2013-09-26 16:09:31 +0100 |
|---|---|---|
| committer | Tom Christie | 2013-09-26 16:09:31 +0100 |
| commit | 1fd83adb9c1f888ed05d5b6d570b5e37996f96ba (patch) | |
| tree | 35fef6873d7c643aea1deb7cc903b179662eed4d /rest_framework/compat.py | |
| parent | 75d6446c8799763dccde0f5f03fbcae39c18dc7f (diff) | |
| parent | 57a51f790bdff6c1cf34f3c6d64b0bef3033d89e (diff) | |
| download | django-rest-framework-1fd83adb9c1f888ed05d5b6d570b5e37996f96ba.tar.bz2 | |
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
Diffstat (limited to 'rest_framework/compat.py')
| -rw-r--r-- | rest_framework/compat.py | 8 |
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 |
