From 625ae4ef9353977cf2d738893e8f98f2a78be2bc Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 6 Dec 2006 17:36:48 +0000 Subject: [PATCH] Added preliminary stub for docs/newforms.txt git-svn-id: http://code.djangoproject.com/svn/django/trunk@4168 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/newforms.txt | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 docs/newforms.txt diff --git a/docs/newforms.txt b/docs/newforms.txt new file mode 100644 index 0000000000..b668738e76 --- /dev/null +++ b/docs/newforms.txt @@ -0,0 +1,70 @@ +==================== +The newforms library +==================== + +``django.newforms`` is a new replacement for ``django.forms``, the old Django +form/manipulator/validation framework. This functionality is new in the Django +development version -- i.e., it's not available in the Django 0.95 release. + +This document explains how to use this new form library. + +Migration plan +============== + +``django.newforms`` currently is only available in the Django development version +-- i.e., it's not available in the Django 0.95 release. For the next Django +release, our plan is to do the following: + + * Move the current ``django.forms`` to ``django.oldforms``. This will allow + for an eased migration of form code. You'll just have to change your + import statements:: + + from django import forms # old + from django import oldforms as forms # new + + * Move the current ``django.newforms`` to ``django.forms``. + + * We will remove ``django.oldforms`` in the release *after* the next Django + release -- i.e., the release that comes after the release in which we're + creating ``django.oldforms``. + +With this in mind, we recommend you use the following import statement when +using ``django.newforms``:: + + from django import newforms as forms + +This way, your code can refer to the ``forms`` module, and when +``django.newforms`` is renamed to ``django.forms``, you'll only have to change +your ``import`` statements. + +If you prefer "``import *``" syntax, you can do the following:: + + from django.newforms import * + +This will import all fields, widgets, form classes and other various utilities +into your local namespace. Some people find this convenient; others find it +too messy. The choice is yours. + +Overview +======== + +As the ``django.forms`` system before it, ``django.newforms`` is intended to +handle HTML form display, validation and redisplay. It's what you use if you +want to perform server-side validation for an HTML form. + +The library deals with these concepts: + + * **Widget** -- A class that corresponds to an HTML form widget, e.g. + ```` or ``