summaryrefslogtreecommitdiff
path: root/django/newforms/forms.py
AgeCommit message (Collapse)Author
2006-12-15newforms: Split the Form class into BaseForm and Form. The former has all ↵Adrian Holovaty
the Form logic; the latter just implements the metaclass that allows for declarative form definition. This change makes it easier to allow other (i.e., non-declarative) designation of a form's fields in creating a form class git-svn-id: http://code.djangoproject.com/svn/django/trunk@4204 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-13Fixed #3139 -- newforms BoundField no longer returns empty errors when using ↵Adrian Holovaty
a prefix. Thanks, jkocherhans git-svn-id: http://code.djangoproject.com/svn/django/trunk@4199 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-13Fixed #3112 -- Changed newforms Form.as_table() to use <th> instead of <td> ↵Adrian Holovaty
for first column git-svn-id: http://code.djangoproject.com/svn/django/trunk@4197 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-13Fixed #3114 -- newforms MultipleChoiceField now handles MultiValueDicts ↵Adrian Holovaty
properly. Thanks for the patch, Honza Král git-svn-id: http://code.djangoproject.com/svn/django/trunk@4196 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-12Fixed #3132 -- Added prefix support for newforms. Thanks, jkocherhansAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4194 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-11newforms: Changed Form to use auto_id by defaultAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4192 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-08Fixed #3102 -- newforms: Fields can now designate their human-friendly ↵Adrian Holovaty
labels. BoundField.verbose_name is now BoundField.label git-svn-id: http://code.djangoproject.com/svn/django/trunk@4188 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07newforms: Changed Form._html_output() to use dictionary-style format strings ↵Adrian Holovaty
for more flexibility. Thanks, Waylan Limberg git-svn-id: http://code.djangoproject.com/svn/django/trunk@4182 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07newforms: Abstracted common code in Form as_table(), as_ul() and as_p() into ↵Adrian Holovaty
Form._html_output(). It's slightly obscure but saves on a lot of redundancy and code bloat. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4179 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07Fixed #3107 -- newforms: Added Form.as_p()Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4178 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07newforms: Form.as_ul() no longer puts hidden fields between <li>s. Similar ↵Adrian Holovaty
to [4175], which was the same thing for Form.as_table(). Refs #3101 git-svn-id: http://code.djangoproject.com/svn/django/trunk@4177 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07newforms: Same fix as [4174], except for Form.as_table()Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4176 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07Fixed #3101 -- newforms: Form.as_table() no longer puts hidden fields ↵Adrian Holovaty
between <tr>s. Thanks for reporting, Eric git-svn-id: http://code.djangoproject.com/svn/django/trunk@4175 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07newforms: Small potential bugfix in Form.as_ul() -- called unicode() on ↵Adrian Holovaty
BoundField rather than str() git-svn-id: http://code.djangoproject.com/svn/django/trunk@4174 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07newforms: Changed Table.as_table() and Table.as_ul() to put hidden-form ↵Adrian Holovaty
errors at the top of the output rather than in field order git-svn-id: http://code.djangoproject.com/svn/django/trunk@4173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07newforms: Simplified BoundField._errors()Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-05newforms: Added __unicode__() methods wherever there were __str__() methods, ↵Adrian Holovaty
and changed the __str__() methods to delegate to __unicode__().encode(settings.DEFAULT_CHARSET) git-svn-id: http://code.djangoproject.com/svn/django/trunk@4163 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-05newforms: Changed BoundField form, field and name attributes to remove ↵Adrian Holovaty
leading underscore to imply that they can be accessed git-svn-id: http://code.djangoproject.com/svn/django/trunk@4160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-30Fixed #3082 -- newforms: Changed Form as_table() and as_ul() not to display ↵Adrian Holovaty
verbose names for hidden fields, and to add field-name prefix to error messages to avoid user confusion. Also added unit tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4146 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-30newforms: Added BoundField.as_hidden()Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-29newforms: Added BoundField.data propertyAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-29newforms: Added Widget.value_from_datadict hook, which allows a Widget to ↵Adrian Holovaty
define how to convert its post data dictionary to a value. Implemented it for CheckboxSelectMultiple and updated unit tests git-svn-id: http://code.djangoproject.com/svn/django/trunk@4136 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-29Fixed #3078 -- newforms: Added HTML escaping to label_tag() calls. Thanks, ↵Adrian Holovaty
SmileyChris git-svn-id: http://code.djangoproject.com/svn/django/trunk@4133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-29newforms: The <input> tags in a RadioSelect now each have a distinct ID. ↵Adrian Holovaty
Also, this plays nicely with auto_id and <label>s for Form.as_table() and Form.as_ul(). Refs #3064 git-svn-id: http://code.djangoproject.com/svn/django/trunk@4131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-29Fixed #3064 -- newforms: Added <label> support through ↵Adrian Holovaty
BoundField.label_tag() method. Also added BoundField.verbose_name and added/updated unit tests. Thanks, SmileyChris git-svn-id: http://code.djangoproject.com/svn/django/trunk@4130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27newforms: Small short-circuit optimization to BoundField.as_widget()Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27newforms: Normalized all error <ul>s to use class='errorlist'Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27newforms: Added Form.non_field_errors() and added more ↵Adrian Holovaty
examples/documentation to the unit tests git-svn-id: http://code.djangoproject.com/svn/django/trunk@4119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27newforms: Added BoundField.label, which calculates the label of the field ↵Adrian Holovaty
based on its name git-svn-id: http://code.djangoproject.com/svn/django/trunk@4118 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27Fixed #3026 -- newforms: Form class now suppresses validation and errors if ↵Adrian Holovaty
no data (or None) is passed in. Validation still happens if you pass in an empty dictionary. Also updated unit tests. Thanks, SmileyChris git-svn-id: http://code.djangoproject.com/svn/django/trunk@4117 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27newforms: Changed Form.errors to be a property rather than a function. Refs ↵Adrian Holovaty
#3026 git-svn-id: http://code.djangoproject.com/svn/django/trunk@4116 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27newforms: Removed redundant declaration of Form.clean(). Thanks, ↵Adrian Holovaty
SmileyChris. Refs #3026 git-svn-id: http://code.djangoproject.com/svn/django/trunk@4115 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-26Fixed #3065 -- newforms: Fixed rendering problem with RadioSelect as a ↵Adrian Holovaty
member of a Form. Also fixed some Unicode issues and added unit tests. Thanks for reporting, Derek Hoy git-svn-id: http://code.djangoproject.com/svn/django/trunk@4106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-23Fixed #3054 -- newforms Form now keeps track of field orderAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4093 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-16newforms: Fixed #3027 -- Changed Form as_table(), as_ul(), ↵Adrian Holovaty
as_table_with_errors() and as_ul_with_errors() to exclude <table> and <ul>. Good idea, SmileyChris git-svn-id: http://code.djangoproject.com/svn/django/trunk@4075 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-15Fixed #3025 -- Added auto_id option to Form.__init__(). Thanks, SmileyChrisAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-04django.newforms: Implemented hook for validation not tied to a particular ↵Adrian Holovaty
field. Renamed to_python() to clean() -- it's just...cleaner. Added Form.as_table(), Form.as_url(), Form.as_table_with_errors() and Form.as_ul_with_errors(). Added ComboField. Updated all unit tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3978 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-28Split django.newforms into forms, fields, widgets, util. Also moved unit ↵Adrian Holovaty
tests from docstrings to a standalone module in tests/regressiontests/forms, to save docstring memory overhead, keep code readable and fit our exisitng convention git-svn-id: http://code.djangoproject.com/svn/django/trunk@3945 bcc190cf-cafb-0310-a4f2-bffc1f526a37