Properly render file inputs in the Browsable api.

This commit is contained in:
Marko Tibold 2012-11-14 00:09:39 +01:00
parent 5443dd5f3c
commit 8cdbc0a33a
2 changed files with 4 additions and 2 deletions

View File

@ -908,7 +908,7 @@ class FloatField(WritableField):
class FileField(WritableField): class FileField(WritableField):
type_name = 'FileField' type_name = 'FileField'
widget = widgets.FileInput
default_error_messages = { default_error_messages = {
'invalid': _("No file was submitted. Check the encoding type on the form."), 'invalid': _("No file was submitted. Check the encoding type on the form."),
'missing': _("No file was submitted."), 'missing': _("No file was submitted."),

View File

@ -320,7 +320,9 @@ class BrowsableAPIRenderer(BaseRenderer):
serializers.SlugRelatedField: forms.ChoiceField, serializers.SlugRelatedField: forms.ChoiceField,
serializers.ManySlugRelatedField: forms.MultipleChoiceField, serializers.ManySlugRelatedField: forms.MultipleChoiceField,
serializers.HyperlinkedRelatedField: forms.ChoiceField, serializers.HyperlinkedRelatedField: forms.ChoiceField,
serializers.ManyHyperlinkedRelatedField: forms.MultipleChoiceField serializers.ManyHyperlinkedRelatedField: forms.MultipleChoiceField,
serializers.FileField: forms.FileField,
serializers.ImageField: forms.ImageField,
} }
fields = {} fields = {}