diff options
| author | Oscar Vilaplana | 2013-05-18 18:27:53 +0200 |
|---|---|---|
| committer | Oscar Vilaplana | 2013-05-18 18:27:53 +0200 |
| commit | fecadacab150aab48b8b84f4f0e5340ead74c287 (patch) | |
| tree | 9a2c2465cbec6ab70c801d929410fb74aef2c701 /rest_framework/fields.py | |
| parent | 4dffcb5d77a575793c1dc7c1db5242a3ac2d7345 (diff) | |
| download | django-rest-framework-fecadacab150aab48b8b84f4f0e5340ead74c287.tar.bz2 | |
added tests for form
Diffstat (limited to 'rest_framework/fields.py')
| -rw-r--r-- | rest_framework/fields.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py index b23813ec..544afc98 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -135,8 +135,7 @@ def humanize_field(field): """ humanized = { - 'type': (field.type_name if field.type_name - else humanize_field_type(field.form_field_class)), + 'type': humanize_field_type(field.__class__), 'required': getattr(field, 'required', False), 'label': field.label, } @@ -154,7 +153,8 @@ def humanize_form_fields(form): :return: A dictionary of {field_label: humanized description} """ - fields = SortedDict([(f.name, humanize_field(f)) for f in form.fields]) + fields = SortedDict([(name, humanize_field(field)) + for name, field in form.fields.iteritems()]) return fields |
