diff options
| author | Tom Christie | 2012-12-11 21:07:25 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-12-11 21:07:25 +0000 |
| commit | 405822330958c5432dde56b07a61b223c03ca4c7 (patch) | |
| tree | 5f6305d47e82c37f597d4ae533b0a65546ebd7f0 /rest_framework/compat.py | |
| parent | 17b77fc446df29e7708c210eade8369c7babc466 (diff) | |
| download | django-rest-framework-405822330958c5432dde56b07a61b223c03ca4c7.tar.bz2 | |
Fix broken nested fields
Diffstat (limited to 'rest_framework/compat.py')
| -rw-r--r-- | rest_framework/compat.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 09b76368..d4901437 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -19,6 +19,16 @@ except ImportError: import StringIO +# Try to import PIL in either of the two ways it can end up installed. +try: + from PIL import Image +except ImportError: + try: + import Image + except ImportError: + Image = None + + def get_concrete_model(model_cls): try: return model_cls._meta.concrete_model |
