From e1c9234307acc286ffc8a17bcbf06e0205c6a22a Mon Sep 17 00:00:00 2001 From: Sacha Zyto Date: Tue, 15 Dec 2015 15:15:42 -0500 Subject: [PATCH] use FileSerializer to serialize FieldFile --- swampdragon/serializers/field_serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swampdragon/serializers/field_serializers.py b/swampdragon/serializers/field_serializers.py index 5dae1c2..609601f 100644 --- a/swampdragon/serializers/field_serializers.py +++ b/swampdragon/serializers/field_serializers.py @@ -1,6 +1,6 @@ from datetime import date from decimal import Decimal -from django.db.models.fields.files import ImageFieldFile, FileField +from django.db.models.fields.files import ImageFieldFile, FileField, FieldFile class BaseSerializer(object): @@ -31,6 +31,6 @@ def serialize_field(value): return DateSerializer().serialize(value) if isinstance(value, Decimal): return DateSerializer().serialize(value) - if isinstance(value, ImageFieldFile) or isinstance(value, FileField): + if isinstance(value, ImageFieldFile) or isinstance(value, FileField) or isinstance(value, FieldFile): return FileSerializer().serialize(value) return value