Commit Graph

375 Commits

Author SHA1 Message Date
Russell Keith-Magee 4a1f2129d0 Fixed #12398 -- Added a TypedMultipleChoiceField. Thanks to Tai Lee.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14829 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-05 04:47:19 +00:00
Russell Keith-Magee ae7213b593 Fixed #14563 -- Added Turkish localflavor. Thanks to serkank for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14794 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04 05:25:24 +00:00
Chris Beaven d3f5f219f5 Fixes #10427 -- Abstract the value generation of a BoundField
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14734 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-28 02:50:31 +00:00
Honza Král 65b380e74a Fixed #11418 -- formset.cleaned_data no longer raises AttributeError when is_valid is True. Thanks mlavin!
This also introduces a slightly backwards-incompatible change in
FormSet's behavior, see the release docs for details.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14667 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 17:27:01 +00:00
Chris Beaven b8a78804b5 Fixes #13804 -- URLField validation failure for a url containing '://' on the path and no scheme
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14657 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 10:08:28 +00:00
Carl Meyer 61a89f8e1b Fixed poorly-constructed test from r14612. Thanks to Alex Gaynor for the eagle eyes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14635 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-20 00:05:11 +00:00
Alex Gaynor a3e7ee7c40 Began converting localflavor doctests into unittests, starting with the German ones. Also introduced a new base class to facilitate ease of testing form fields. We have always been at war with doctests. Thanks to Idan Gazit for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14626 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-19 19:33:07 +00:00
Carl Meyer 38ba3775ec Fixed #14234 -- Re-validating a model instance added via ModelForm no longer throws spurious PK uniqueness errors. Thanks to David Reynolds and Jeremy Dunck.
Also moved Model._adding to Model._state.adding to reduce instance namespace footprint.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14612 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-18 22:43:46 +00:00
Jannis Leidel 33d8fcde8a Fixed #14693, #14709 -- Backwards incompatible change to rectify the confusion around the STATICFILES_URL and STATICFILES_ROOT settings.
* Two new global settings that will be used by -- **but are not limited to** -- the staticfiles app: STATIC_ROOT and STATIC_URL.

  * Moving the 'django.contrib.staticfiles.templatetags.staticfiles' template tag to the core ('django.templatetags.static') and renaming it to 'get_static_prefix'.

  * Moving the context processor 'django.contrib.staticfiles.context_processors.staticfiles' to the core ('django.core.context_processors.static') and renaming it to 'static'.

  * Paths in media definitions will use STATIC_URL as the prefix if the value is not None, and falls back to the previously used MEDIA_URL.

Thanks again to the community for constructive criticism and Carl and Russ for sanity-inducing discussions on IRC.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14592 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-17 15:36:26 +00:00
Russell Keith-Magee 8bafde1229 Migrated forms (minus localflavor) doctests. A huge thanks to Daniel Lindsley for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14570 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-16 13:20:56 +00:00
Russell Keith-Magee 3d96540b80 Added a filter to silence the RuntimeWarning in the Indonesian localflavor tests. Thanks to Alex for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14418 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-01 23:46:37 +00:00
Honza Král c5df329996 Fixed #12074 -- Adding .as_p and as_ul methods to FormSet. Thanks arthurdebert and dpn for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-18 04:44:49 +00:00
Honza Král 59952b6f9a Fixed Indonesion localflavor tests, broken in r14195
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-18 04:41:22 +00:00
Alex Gaynor 5a8e40a03f Fixed #11350 -- added an Israeli localflavor. Thanks to Yuval and Idan Gazit for their work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-15 02:58:10 +00:00
Alex Gaynor 5506653b77 Fixed #5416 -- Added TestCase.assertNumQueries, which tests that a given function executes the correct number of queries.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-12 03:33:19 +00:00
Jannis Leidel 6ddfe26932 Fixed #14349 -- Added Belgium localflavor. Thanks for the report and patch, Laurent Luce.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-11 23:35:23 +00:00
Russell Keith-Magee 121d2e3678 Fixed #12991 -- Added unittest2 support. Thanks to PaulM for the draft patch, and to Luke, Karen, Justin, Alex, Łukasz Rekucki, and Chuck Harmston for their help testing and reviewing the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-11 12:55:17 +00:00
Adrian Holovaty bf0947a474 Fixed #11907 -- EmailField now runs strip() on its input. This means mistakenly including leading or trailing spaces will not cause a validation error, and clean() will remove those spaces. Thanks, krisneuharth, djansoft and SmileyChris
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13997 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-07 15:50:36 +00:00
Jannis Leidel 392d992f82 Fixed #7048 -- Added ClearableFileInput widget to clear file fields. Thanks for report and patch, jarrow and Carl Meyer.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-01 02:02:58 +00:00
Malcolm Tredinnick 631bb7d0f6 Added a test for hidden SplitDateTime fields. Thanks, seveas.
Fixed #11213

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-12 22:27:59 +00:00
Justin Bronn 4311402216 Fixed #13390 -- `SplitDateTimeWidget` now recognizes when it's no longer required. Thanks vaxXxa for bug report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13753 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-11 21:26:19 +00:00
Russell Keith-Magee ce98a29eb7 Fixed #14159 -- Corrected more potential uses of relative paths in tests. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13636 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-24 02:26:14 +00:00
Russell Keith-Magee b3dc3a0106 Fixed #13679, #13231, #7287 -- Ensured that models that have ForeignKeys/ManyToManyField can use a a callable default that returns a model instance/queryset. #13679 was a regression in behavior; the other two tickets are pleasant side effects. Thanks to 3point2 for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-14 12:05:41 +00:00
Luke Plant 550912c513 Fixed #8426 - added 'helptext' CSS class to help text in forms to aid in styling
Thanks to erikcw for report, mrts and rpbarlow for patch



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-06 17:47:58 +00:00
Russell Keith-Magee d3ba8cb88b Fixed #13316 -- Modified the default behavior of PasswordInput to prevent reflecting passwords on form failure. Thanks to clouserw for the report.
Although this changes nothing at a functional level, this is BACKWARDS INCOMPATIBLE from a UX perspective for anyone that wants passwords to be reflected to the user on form failure. See the 1.3 release notes for details.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-06 14:25:58 +00:00
Russell Keith-Magee 75d018f631 Fixed #13621 -- Corrected the handling of input formats on date/time form fields. Thanks to bufke for the report, zerok and jacmkno for their work on the patch, and Karen, Jannis and Alex for feedback.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13484 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-05 12:50:30 +00:00
Russell Keith-Magee 25f0ff48ac Fixed #13732 -- Fixed minor typo in docstring. Thanks to schinckel for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13483 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-05 12:49:48 +00:00
Jannis Leidel e6ec07dc1f Fixed #13592 -- Make sure the SelectDateWidget works with dates before 1900 when localization is enabled. Thanks for the report and patch, magnus.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13301 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-23 10:38:23 +00:00
Jannis Leidel b057a8b247 Fixed #13560 -- Fixed localization of widgets.
Particularly this fixes the SplitDateTimeField and the AdminDateWidget by localizating the widget's value in its render method instead of the form field. Thanks to David Danier for the report and Russell for help with the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-21 14:07:54 +00:00
Russell Keith-Magee d0d3e6792d Fixed #13524 -- Added backwards compatibility and feature notes regarding admin inlines and formsets. Thanks to Ramiro Morales and Gabriel Hurley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-12 11:56:42 +00:00
Russell Keith-Magee 5211f48ae3 Fixed #12164 -- Removed the Python 2.3 compatibility imports and workarounds. Thanks to timo and claudep for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04 14:00:30 +00:00
Russell Keith-Magee 5926a26e92 Fixed #12986 -- Ensured that SelectDateField repopulates correctly when USE_L10N=True and locale has a default date input format other than %Y-%m-%d. Thanks to wim@go2people.nl for the report, and walteralini for his draft patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13041 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-28 15:39:26 +00:00
Russell Keith-Magee b131561112 Fixed #13374 -- Modified a test so that it can pass under PyPy. This is a reimplementation of part of r12998, reverted in r13008. Thanks to Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13010 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-21 11:33:39 +00:00
Karen Tracey 829c5fdbee Revert part of r12998 that prevents the forms doctests in tests.py from running.
Adjust the fr.py localflavor tests to account for r13007.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@13008 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-20 20:39:22 +00:00
Russell Keith-Magee 56eb340528 Fixed #13374 -- Corrected some more minor issues causing problems for PyPy. Thanks to Alex Gaynor for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-19 11:52:56 +00:00
Russell Keith-Magee b7b38a41b0 Fixed #13229 -- Corrected a test failure caused by the change in Finnish municipalities from r12958. Thanks to Karen for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12962 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-12 23:53:27 +00:00
Jannis Leidel aba95dcc0b Fixed #13023 - Removed ambiguity with regard to the max_num option of formsets and as a result of admin inlines. Thanks to Gabriel Hurley for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12872 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-27 23:03:56 +00:00
Russell Keith-Magee 4120a181e9 Fixed #11801 -- Corrected form validation to ensure you can still get deleted_forms and ordered_forms when a form that is being deleted doesn't validate. Thanks to dantallis for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12771 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-12 15:51:00 +00:00
Luke Plant e316b8b981 Fixed #12048 - MultiWidget does not define `__deepcopy__`
Thanks to powderflask for report, test case and initial patch



git-svn-id: http://code.djangoproject.com/svn/django/trunk@12739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-09 22:52:04 +00:00
Luke Plant bae921dcff Fixed #11940 - ModelForm evaluates callable default values on form class creation
Thanks to Harm Geerts for the report and initial patch.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@12721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-08 15:03:30 +00:00
Joseph Kocherhans 5beb5f7372 Fixed #12858. DateTime related widgets now handle custom formats properly in _has_changed. Thanks for the initial patch, camillo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12698 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-07 03:33:07 +00:00
James Bennett 6edcd11aed Expanded the fix in [12663] to cover CSS declarations, which were also affected by the bug. Refs #12879.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12665 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-03 08:17:51 +00:00
James Bennett 9a82ca0a36 Fixed #12879: Declaring the same JS file multiple times in a single Media instance now only includes that file once.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12663 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-03 08:01:48 +00:00
Jannis Leidel 68f216a692 Fixed #12989 - Fixed verification of IDN URLs. Thanks to Fraser Nevett for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12620 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-28 12:01:18 +00:00
Joseph Kocherhans 445e0a5c3e Fixed #9336. Changed CheckboxInput to render 'True' and 'False' input strings as checked or not instead of as a value attribute. Thanks, bthomas.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-23 23:37:45 +00:00
Joseph Kocherhans ea3853e8d2 Fixed #12878. Formset-wide errors are now rendered properly as html.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-23 20:55:42 +00:00
Joseph Kocherhans 871a99c948 Fixed #11860. Changed NullBooleanSelect's _has_changed method to repect differences between None and False. Thanks, matiasb.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12523 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-23 14:17:42 +00:00
Russell Keith-Magee 692fd7da5e Fixed #7777 -- Added validation handling for NaN, Inf and -Inf in DecimalFields. Thanks to thebitguru for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-22 14:38:44 +00:00
Jannis Leidel 7f5d9ad661 Fixed #9764 - Updated EmailField and URLField to support IDN (Internationalized Domain Names). Thanks, UloPe.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12474 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-21 23:44:35 +00:00
Jannis Leidel 9555f2be9d Fixed #12692 - Properly handle the extra clause of admin inline formsets. Also fixes #12703, second error.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12369 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-01 14:14:56 +00:00
Jannis Leidel c14937cf7a Fixed #12508 - Added ability to dynamically add inlines in the admin app.
Refs #13. Also introduces an ``empty_form`` attribute on formsets to make it easier to implement dynamic forms.

Many thanks to Zain Memon for the initial patch from his Summer of Code 2009 project, Stanislaus Madueke for his django-dynamic-formset app and all the other people helping out.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-26 15:02:53 +00:00
Jannis Leidel 235bf7f1f7 Fixed test introduced in r12044 to actually test the issue.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-17 22:49:27 +00:00
Jacob Kaplan-Moss 5bc344ceca Fixed a form test from [12211] that didn't clean up after itself. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-16 22:45:39 +00:00
Joseph Kocherhans 223b2721aa Fixed #12510. Changed ModelChoiceField to stop using some of its superclasses implementation. This could cause more than one query when generating choices. Thanks, Petr Marhoun and Honza Kral.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-12 14:58:24 +00:00
Jannis Leidel 73d8abf3d5 Removed unneeded import, thanks Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12154 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-09 22:51:21 +00:00
Jannis Leidel 5e83b79d26 Fixed #12466 - Set HTML class attributes for each field separately. Thanks for the patch, Bernd Schlapsi.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-09 22:51:03 +00:00
Jannis Leidel 4700200383 Fixed #11301 - Properly hide SplitHiddenDateTimeWidget. Thanks to David Gouldin for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12152 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-09 22:34:13 +00:00
Jannis Leidel 341c85bed0 Fixed #11843 - Give MultipleHiddenInput different IDs. Thanks Chris Beaven.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12151 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-09 22:14:01 +00:00
Joseph Kocherhans 471596fc1a Merged soc2009/model-validation to trunk. Thanks, Honza!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-05 03:56:19 +00:00
Jannis Leidel 63662ff924 Fixed #8735 - Added Portuguese (pt) local flavor. Thanks Alcides Fonseca for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12047 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:35:26 +00:00
Jannis Leidel e0dc28df55 Fixed #8612 - Added Indonesian (id) localflavor. Thanks to Ronny Haryanto for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:34:50 +00:00
Jannis Leidel 4b2e674329 Fixed #12017 - Overriding the default error message of the UKPostcodeField works again.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12044 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:33:30 +00:00
Jannis Leidel 6eb205c914 Fixed #11123 - Added Irish (ie) localflavor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12043 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:33:00 +00:00
Jannis Leidel 82b33b1d80 Fixed #8068 - Added Kuwaiti (kw) localflavor. Thanks to Ahmad Al-Ibrahim for providing the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12042 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:32:24 +00:00
Jannis Leidel 3825bb2350 Fixed #10736 - Added Uruguayan (uy) localflavor. Thanks to Gonzalo Saavedra for providing the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12041 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-01 21:31:47 +00:00
Jannis Leidel bf33d3eb1d Fixed #12444 - Date based widgets now correctly handle input values when using locale-aware formatting. Also fixes #7656.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12029 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-30 22:11:48 +00:00
Jannis Leidel d320deef25 Fixed #9289 - Added Swedish localflavor. Thanks to Andreas Pelme, Ludvig Ericson and Filip Noetzel for working on a patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11969 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22 21:10:40 +00:00
Brian Rosner bd12310427 Converted regressiontests/forms/fields.py to unittests
This makes merging in the soc2009/model-validation simpler and rids us a
little bit more of awful doctests. Thanks Honza!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-13 22:00:26 +00:00
Karen Tracey 0fe8c20a28 Fixed #12146: Corrected Canadian postal code validation. Thanks paulschreiber and Mark Lavin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-13 17:01:22 +00:00
Jacob Kaplan-Moss 92803205cb Fixed #3512: it's now possible to add CSS hooks to required/erroneous form rows. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11830 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-12 18:52:12 +00:00
Karen Tracey 9c4bd2aa33 Fixed #11632: Fixed the id for hidden initial widget so that it is different from the id for its visible counterpart. Thanks geber@datacollect.com and Mark Lavin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11826 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-12 18:18:31 +00:00
Jacob Kaplan-Moss f5fefcc8c9 Added an explicit test showing that field errors are correctly autoescaped.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11756 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-20 14:59:44 +00:00
Jacob Kaplan-Moss 9f8287a3f1 SECURITY ALERT: Corrected regular expressions for URL and email fields.
Certain email addresses/URLs could trigger a catastrophic backtracking situation, causing 100% CPU and server overload. If deliberately triggered, this could be the basis of a denial-of-service attack.

This security vulnerability was disclosed in public, so we're skipping our
normal security release process to get the fix out as soon as possible.

This is a security related update. A full announcement, as well as backports for the 1.1.X and 1.0.X series will follow.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11603 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-09 20:57:59 +00:00
Luke Plant 7c53c2618d Fixed #10968 - Form.errors should use Form.error_class.
Thanks for report and initial patch, matehat.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@11498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-09-11 10:47:40 +00:00
Russell Keith-Magee 5663258de1 Fixed #10792 -- Ensured that ModelChoiceFields don't provide an empty option when the underlying field has blank=False and there is a default value available. Thanks to carljm for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-10 07:44:27 +00:00
Jacob Kaplan-Moss 7caf21aa2e Make sure that all uses of max_length in the test suite use values smaller than 255. If we use max_length > 255 the test suite can't be run on MySQL 4.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 18:06:22 +00:00
Russell Keith-Magee f6cca736a0 Fixed #9609 -- Modified the clean method of(Null)Boolean field to accept '1' and '0' as valid inputs. Thanks to psagers for the patch.
This is required to support the use of non-default form widgets such as RadioSelect when the data comes from MySQL, which uses 1/0 to represent booleans.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10660 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-02 14:52:34 +00:00
Russell Keith-Magee fbf5eaac94 Fixed #10349 -- Modified ManyToManyFields to allow initial form values to be callables. Thanks to fas for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10652 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-02 07:03:33 +00:00
Russell Keith-Magee 2ba9df2f41 Fixed #10082 -- Modified BaseFormSet so that ordering checks work when the formset is empty. Thanks to Petr Marhoun for the report and test case, and bmathieu for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10643 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-28 14:17:18 +00:00
Russell Keith-Magee 6312de0279 Fixed #10288 -- Corrected _has_changed handling of DateTimeInput, DateInput, TimeInput, and SplitDateTimeWidget when a custom date/time format is in use. Thanks to Koen Biermans for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10641 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-28 13:19:30 +00:00
Jacob Kaplan-Moss 002e3fd9e4 Fixed #9124: fixed `SelectDateWidget` with `required=False`. Thanks, Bernd Schlapsi.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10584 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-18 17:35:53 +00:00
Russell Keith-Magee 419ed44436 Fixed #10363 -- Modified ModelForm handling to ensure that excluded fields can't be saved onto the model. Thanks to jgoldberg for the report, an Alex Gaynor for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10575 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16 14:26:08 +00:00
Russell Keith-Magee 6590061a00 Fixed #9948 -- Corrected URLField validation to match RFC1035 (URL analog of #9890). Thanks to kratorius for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10574 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16 14:25:18 +00:00
Russell Keith-Magee 48b459a83e Fixed #9890 -- Modified the regex validation for email addresses to match RFC822/1035. Thanks to ozgur for the report, and kratorius for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10573 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16 14:24:27 +00:00
Jacob Kaplan-Moss 95f5e4a8da Fixed #10774: accessing form media types in templates (i.e. ``{{ form.media.js }}``) now works. Thanks, tarequeh and Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10489 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-10 17:07:25 +00:00
Malcolm Tredinnick f6309cbf80 Fixed #8515 -- Fixed validation of Polish REGON numbers.
Patch from Piotr Lewandowski.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10460 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-10 01:03:44 +00:00
Karen Tracey d0c897d660 Made a set of small test changes to avoid leaving temp files hanging around after running the test suite. First, fixed a couple of places where temp dirs were (or could be) created without later being deleted. Second, added a missing close() before unlink() since Windows raises an error on an attempt to remove an open file. Finally, in the file_uploads tests, avoided opening-by-name temporary files that we already have a descriptor for. Doing additional opens seems to run afoul of the Windows issue with deleting open files, so it generally works better to just seek back to 0 instead of calling open multiple times.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10406 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-05 20:59:20 +00:00
Joseph Kocherhans fea6c73538 Fixed #10149. FileFields in a form now validate max_length. Based on a patch by Massimo Scamarcia.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 22:52:16 +00:00
Joseph Kocherhans 08056572e8 Fixed #9587. Formset.is_valid() now returns True if an invalid form is marked for deletion. Thanks for the test and intial patch, kratorius.
Note that this leaves the form and formset errors alone. Those forms still have errors, it's just that it doesn't matter that they're invalid in the context of the formset and deletion.
Also fixed #9665 while I was in there. Thanks, mark_hildreth.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30 19:36:19 +00:00
Karen Tracey 14b160957e Fixed #8962 -- Consistently support format and input_format in the various (individual, combined, split) date and time form fields and widgets.
Many thanks to Tai Lee for doing all the work here.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@10115 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-22 16:13:06 +00:00
Malcolm Tredinnick ec710220dd Fixed some test output in the wake of r9940.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9944 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 04:17:00 +00:00
Russell Keith-Magee b2a4377651 Fixed #9066 -- Added Czech localflavor. Thanks to Elvard for the contribution.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9876 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-22 07:51:57 +00:00
Jacob Kaplan-Moss 79138a6106 Fixed #10041: use a tempdir for files in the forms test. Thanks, Marty Alchin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9765 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-16 21:31:58 +00:00
Malcolm Tredinnick bfab9d62ee Added a way to iterate over hidden/visible fields in a form. Useful for manual
form layout.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9569 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-05 04:22:00 +00:00
Karen Tracey ad4e1a7a72 Add tests mistakenly left out of r9397.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9388 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 20:01:51 +00:00
Karen Tracey d82aaef844 Fixed #7064: Made DemicmalField validation support max_digits equal to decimal_places.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 19:52:53 +00:00
Karen Tracey 8cdc53a265 Fixed #6035 -- Gave the SplitDateTimeField the proper default widget. Thanks dtulig.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 19:42:55 +00:00
Karen Tracey bcd63cbfb0 Fixed #6160, #9111 -- Consistently apply conditional_escape to form errors and labels when outputing them as HTML.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9365 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-06 19:49:24 +00:00
Malcolm Tredinnick 7cec38b076 Fixed #9259 -- Fixed a validation error for Spanish identity card numbers.
Patch from Marc Garcia.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:59:04 +00:00
Malcolm Tredinnick 9931c9e132 Fixed #9125 -- When displaying errors for a form with only hidden fields, make sure the resulting XHTML is correct.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-18 07:16:08 +00:00