diff options
| author | Chris Wilson <chris+github@qwirx.com> | 2014-03-04 14:12:13 +0000 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-03-05 20:09:28 +0100 |
| commit | 95c74b9d699c29fe808684774548e2864d64665a (patch) | |
| tree | 8edba19c8beba0a514b65f2f28a2c8c02e47b91f /docs | |
| parent | ac699cdc174a825e6b78c6f3c6e967bc961413c8 (diff) | |
Fixed #22206 -- Passed models.TextField.max_length to forms.CharField.maxlength
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/fields.txt | 7 | ||||
| -rw-r--r-- | docs/releases/1.7.txt | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 4e02c66ca0..b3523334c0 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -968,6 +968,13 @@ databases supported by Django. A large text field. The default form widget for this field is a :class:`~django.forms.Textarea`. +.. versionchanged:: 1.7 + + If you specify a ``max_length`` attribute, it will be reflected in the + :class:`~django.forms.Textarea` widget of the auto-generated form field. + However it is not enforced at the model or database level. Use a + :class:`CharField` for that. + .. admonition:: MySQL users If you are using this field with MySQLdb 1.2.1p2 and the ``utf8_bin`` diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index 441a39616a..096415c5b8 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -488,6 +488,10 @@ Forms Each radio button or checkbox includes an ``id_for_label`` attribute to output the element's ID. +* The ``<textarea>`` tags rendered by :class:`~django.forms.Textarea` now + include a ``maxlength`` attribute if the :class:`~django.db.models.TextField` + model field has a ``max_length``. + * :attr:`Field.choices<django.db.models.Field.choices>` now allows you to customize the "empty choice" label by including a tuple with an empty string or ``None`` for the key and the custom label as the value. The default blank |
