Skip to content

Commit 1332b11

Browse files
committed
[1.1.X] Fixed #12601: Documented the slug field in the forms module. Backport of [12673] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12674 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 36e7739 commit 1332b11

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/ref/forms/fields.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,21 @@ compatibility. The preferred way to provide an error message is to use the
643643
``error_messages`` argument, passing a dictionary with ``'invalid'`` as a key
644644
and the error message as the value.
645645

646+
``SlugField``
647+
~~~~~~~~~~~~~
648+
649+
.. class:: SlugField(**kwargs)
650+
651+
* Default widget: ``TextInput``
652+
* Empty value: ``''`` (an empty string)
653+
* Normalizes to: A Unicode object.
654+
* Validates that the given value contains only letters, numbers and
655+
hyphens.
656+
* Error messages: ``required``, ``invalid``
657+
658+
This field is intended for use in representing a model
659+
:class:`~django.db.models.SlugField` in forms.
660+
646661
``TimeField``
647662
~~~~~~~~~~~~~
648663

0 commit comments

Comments
 (0)