From 4ebd701be74fbb1f44f7763f7ab9e19f6483ac96 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 28 Sep 2012 14:53:22 +0100 Subject: Fix serialization issue with Django 1.3 --- rest_framework/compat.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rest_framework/compat.py') 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): -- cgit v1.2.3