aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/compat.py
diff options
context:
space:
mode:
authorMichal Dvorak (cen38289)2012-12-17 16:35:47 +0100
committerMichal Dvorak (cen38289)2012-12-17 17:01:00 +0100
commit8ac77eaae8d6ad01ec8f6de18134c4aa1961d4dd (patch)
treedbdfdf8d3bdb5fd255ff0c9ce7bad75f34b48b19 /rest_framework/compat.py
parent2a82b64963792b353a7a2634c003692bd4957c9f (diff)
parent70714c234630cd205ed88686ece3b594f387a48f (diff)
downloaddjango-rest-framework-8ac77eaae8d6ad01ec8f6de18134c4aa1961d4dd.tar.bz2
Merge remote-tracking branch 'tom/master'
Conflicts: rest_framework/serializers.py rest_framework/tests/serializer.py
Diffstat (limited to 'rest_framework/compat.py')
-rw-r--r--rest_framework/compat.py10
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