From b689db17b3c1ef5a2bca3a7fa90d3381bd5ba4fe Mon Sep 17 00:00:00 2001 From: Max Arnold Date: Tue, 22 May 2012 12:39:50 +0700 Subject: [PATCH] Allow RawQuerySet serialization --- djangorestframework/serializer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/djangorestframework/serializer.py b/djangorestframework/serializer.py index 5dea37e81..9481eeff1 100644 --- a/djangorestframework/serializer.py +++ b/djangorestframework/serializer.py @@ -2,7 +2,7 @@ Customizable serialization. """ from django.db import models -from django.db.models.query import QuerySet +from django.db.models.query import QuerySet, RawQuerySet from django.utils.encoding import smart_unicode, is_protected_type, smart_str import inspect @@ -261,7 +261,7 @@ class Serializer(object): if isinstance(obj, (dict, models.Model)): # Model instances & dictionaries return self.serialize_model(obj) - elif isinstance(obj, (tuple, list, set, QuerySet, types.GeneratorType)): + elif isinstance(obj, (tuple, list, set, QuerySet, RawQuerySet, types.GeneratorType)): # basic iterables return self.serialize_iter(obj) elif isinstance(obj, models.Manager):