Skip to content

Commit

Permalink
Merge pull request #2340 from shtouff/fix-htmlform-textarea
Browse files Browse the repository at this point in the history
Use textarea input for 'models.TextField'.
  • Loading branch information
tomchristie committed Dec 24, 2014
2 parents e6041f9 + b32ecde commit 9f9b9f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rest_framework/utils/field_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def get_field_kwargs(field_name, model_field):
kwargs['decimal_places'] = decimal_places

if isinstance(model_field, models.TextField):
kwargs['style'] = {'type': 'textarea'}
kwargs['style'] = {'base_template': 'textarea.html'}

if isinstance(model_field, models.AutoField) or not model_field.editable:
# If this field is read-only, then return early.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class Meta:
positive_small_integer_field = IntegerField()
slug_field = SlugField(max_length=100)
small_integer_field = IntegerField()
text_field = CharField(style={'type': 'textarea'})
text_field = CharField(style={'base_template': 'textarea.html'})
time_field = TimeField()
url_field = URLField(max_length=100)
custom_field = ModelField(model_field=<tests.test_model_serializer.CustomField: custom_field>)
Expand Down

0 comments on commit 9f9b9f8

Please sign in to comment.