Commit Graph

27 Commits

Author SHA1 Message Date
Adrian Holovaty e130031fd2 Fixed #3082 -- newforms: Changed Form as_table() and as_ul() not to display 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-30 17:07:40 +00:00
Adrian Holovaty 4dca65cdfc newforms: Added BoundField.as_hidden()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-30 03:58:25 +00:00
Adrian Holovaty 61c93842f4 newforms: Added BoundField.data property
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-29 21:48:58 +00:00
Adrian Holovaty 4a3ad338d6 newforms: Added Widget.value_from_datadict hook, which allows a Widget to 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-29 17:00:34 +00:00
Adrian Holovaty 8aae90c0e5 newforms: Implemented CheckboxSelectMultiple
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4132 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-29 03:02:26 +00:00
Adrian Holovaty fe4af48ec8 newforms: The <input> tags in a RadioSelect now each have a distinct ID. 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-29 01:40:27 +00:00
Adrian Holovaty bb45c394a6 Fixed #3064 -- newforms: Added <label> support through 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-29 00:49:27 +00:00
Adrian Holovaty 3d89f26b08 newforms: Changed Form unit tests to use f.clean_data rather than f.clean(), because the latter is a validation hook, not a way to get the clean data
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-28 23:14:18 +00:00
Adrian Holovaty 190c987e63 newforms: Normalized all error <ul>s to use class='errorlist'
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27 04:56:33 +00:00
Adrian Holovaty 49236b95e9 newforms: Added Form.non_field_errors() and added more examples/documentation to the unit tests
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27 04:49:26 +00:00
Adrian Holovaty 126e0ec0c3 Fixed #3026 -- newforms: Form class now suppresses validation and errors if 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-27 03:49:19 +00:00
Adrian Holovaty 682e435c5f newforms: Changed Form.errors to be a property rather than a function. Refs #3026
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4116 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27 01:55:24 +00:00
Adrian Holovaty 56ad38a826 newforms: Added a bunch of unit tests and fixed some bugs in the case of required=False for various Field subclasses
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27 00:49:26 +00:00
Adrian Holovaty 2e4ff8ee0c Fixed #3038 -- newforms: RegexField no longer validates empty input for required=False. Thanks for reporting, Thomas Steinacher
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4111 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-27 00:23:17 +00:00
Adrian Holovaty 4a14f2e233 Fixed #3065 -- newforms: Fixed rendering problem with RadioSelect as a 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-26 18:44:58 +00:00
Adrian Holovaty 5836b140fa newforms: Added unit test to test field order. Refs #3054
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4092 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-23 17:16:15 +00:00
Adrian Holovaty 6dd4e6d046 newforms: Fixed #3008 -- Widgets now support strings containing utf-8 characters. Thanks for reporting, Nebojša Đorđević
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4076 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-16 06:45:29 +00:00
Adrian Holovaty 75516392b8 newforms: Fixed #3027 -- Changed Form as_table(), as_ul(), 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-16 01:16:33 +00:00
Adrian Holovaty 05420093ae newforms: Added unit test showing it's possible to construct the fields in a Form dynamically
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4074 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-15 23:17:00 +00:00
Adrian Holovaty c4070e86c8 Fixed #3025 -- Added auto_id option to Form.__init__(). Thanks, SmileyChris
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-15 23:09:10 +00:00
Adrian Holovaty 522f674070 newforms: Implemented RadioSelect, with unit tests
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4072 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-15 22:08:22 +00:00
Adrian Holovaty 46b0713315 django.newforms: Implemented hook for validation not tied to a particular 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-11-04 20:49:59 +00:00
Adrian Holovaty 6645d1fe48 Added ChoiceField, MultipleChoiceField to django.newforms
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3959 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-02 03:16:12 +00:00
Adrian Holovaty 36786d28f5 Implemented SelectMultiple in django.newforms.widgets
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3958 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-02 01:06:12 +00:00
Adrian Holovaty 964ccd1023 Updated forms unit tests to reflect new fields and widgets from [3955] and [3956]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3957 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-01 23:54:17 +00:00
Adrian Holovaty bcba29fcd6 Changed forms unit tests to reflect the fact that render() does not use the to_python() value of data
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3946 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-28 20:59:23 +00:00
Adrian Holovaty 88a2f53b85 Split django.newforms into forms, fields, widgets, util. Also moved unit 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
2006-10-28 20:34:37 +00:00