Update rest_framework/serializers.py

This commit is contained in:
Andrea de Marco 2013-01-28 22:08:40 +01:00
parent 141814585c
commit 85e6360792

View File

@ -469,7 +469,7 @@ class ModelSerializer(Serializer):
kwargs['required'] = False kwargs['required'] = False
kwargs['default'] = model_field.get_default() kwargs['default'] = model_field.get_default()
if model_field.__class__ == models.TextField: if issubclass(model_field.__class__, models.TextField):
kwargs['widget'] = widgets.Textarea kwargs['widget'] = widgets.Textarea
# TODO: TypedChoiceField? # TODO: TypedChoiceField?