diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-03-25 21:06:12 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-03-25 21:06:12 +0000 |
| commit | 5d079ee2149616c5c4861b76255e6b7d71c5ab1b (patch) | |
| tree | 9c8645c4d15bd8729e4c4296bd852b9dbe98aed1 /docs | |
| parent | bd8c2fead83ee5e88cb2aa5f851ca493d455fa24 (diff) | |
Added start of 'Creating custom fields' section to docs/newforms.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/newforms.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/newforms.txt b/docs/newforms.txt index d7ef4d2599..ddb850f54c 100644 --- a/docs/newforms.txt +++ b/docs/newforms.txt @@ -860,6 +860,16 @@ level and at the form instance level, and the latter gets precedence:: <tr><th>Url:</th><td><input type="text" name="url" /></td></tr> <tr><th>Comment:</th><td><input type="text" name="comment" /></td></tr> +Creating custom fields +---------------------- + +If the built-in ``Field`` classes don't meet your needs, you can easily create +custom ``Field`` classes. To do this, just create a subclass of +``django.newforms.Field``. Its only requirements are that it implement a +``clean()`` method and that its ``__init__()`` method accept the core arguments +mentioned above (``required``, ``label``, ``initial``, ``widget``, +``help_text``). + More coming soon ================ |
