summaryrefslogtreecommitdiff
path: root/django/forms/fields.py
AgeCommit message (Collapse)Author
2010-05-21Fixed #13560 -- Fixed localization of widgets.Jannis Leidel
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-03-27Fixed #13032 - Added localize parameter to form fields to be able to ↵Jannis Leidel
selectively enable localization. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-01Fixed #12779 - Sanitize numeric form field input according to decimal and ↵Jannis Leidel
thousand separator settings. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12625 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-23Fixed a few more spots related to #11859. Thanks, cramm and Alex Gaynor.Joseph Kocherhans
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12537 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-22Fixed #7777 -- Added validation handling for NaN, Inf and -Inf in ↵Russell Keith-Magee
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-14Fixed #6054: work around PIL's installation brokeness by detecting either of ↵Jacob Kaplan-Moss
the two ways it can end up being installed. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12429 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-05Merged soc2009/model-validation to trunk. Thanks, Honza!Joseph Kocherhans
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-05Fixed deprecation warning nuisance introduced in r11964. Thanks to Luke ↵Jannis Leidel
Plant for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12097 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22Fixed #7980 - Improved i18n framework to support locale aware formatting ↵Jannis Leidel
(dates and numbers) and form processing. Thanks to Marc Garcia for working on this during his Google Summer of Code 2009! Additionally fixes #1061, #2203, #3940, #5526, #6449, #6231, #6693, #6783, #9366 and #10891. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11964 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-17Fixed #11753 - Q objects with callables no longer explode on Python 2.4. ↵Jacob Kaplan-Moss
Thanks, Jeremy Dunck. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-09SECURITY ALERT: Corrected regular expressions for URL and email fields.Jacob Kaplan-Moss
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-09-10Fixed #10950 - unused import.Luke Plant
Thanks dc git-svn-id: http://code.djangoproject.com/svn/django/trunk@11485 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-02Fixed #9609 -- Modified the clean method of(Null)Boolean field to accept '1' ↵Russell Keith-Magee
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-04-16Fixed #9948 -- Corrected URLField validation to match RFC1035 (URL analog of ↵Russell Keith-Magee
#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-16Fixed #9890 -- Modified the regex validation for email addresses to match ↵Russell Keith-Magee
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-08Fixed #8422: FilePathField now respects required=False.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10447 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30Fixed #10149. FileFields in a form now validate max_length. Based on a patch ↵Joseph Kocherhans
by Massimo Scamarcia. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-22Fixed #8962 -- Consistently support format and input_format in the various ↵Karen Tracey
(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
2008-11-10Fixed #7064: Made DemicmalField validation support max_digits equal to ↵Karen Tracey
decimal_places. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10Fixed #6035 -- Gave the SplitDateTimeField the proper default widget. ↵Karen Tracey
Thanks dtulig. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24Fixed #9384 -- Fixed a couple of typos. Thanks, Thomas Güttler and romke.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9255 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01Fixed #7975 -- Callable defaults in inline model formsets now work ↵Brian Rosner
correctly. Based on patch from msaelices. Thanks for your hard work msaelices. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31Added a `TypedChoiceField` which acts just like `ChoiceField`, except that itJacob Kaplan-Moss
returns a value coerced by some provided function. Refs #6967. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8771 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28Fixed #7753: clean `NullBooleanField` correctly when using `HiddenInput`. ↵Jacob Kaplan-Moss
Thanks to julien and ElliottM. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27Removed oldforms, validators, and related code:Gary Wilson Jr
* Removed `Manipulator`, `AutomaticManipulator`, and related classes. * Removed oldforms specific bits from model fields: * Removed `validator_list` and `core` arguments from constructors. * Removed the methods: * `get_manipulator_field_names` * `get_manipulator_field_objs` * `get_manipulator_fields` * `get_manipulator_new_data` * `prepare_field_objs_and_params` * `get_follow` * Renamed `flatten_data` method to `value_to_string` for better alignment with its use by the serialization framework, which was the only remaining code using `flatten_data`. * Removed oldforms methods from `django.db.models.Options` class: `get_followed_related_objects`, `get_data_holders`, `get_follow`, and `has_field_type`. * Removed oldforms-admin specific options from `django.db.models.fields.related` classes: `num_in_admin`, `min_num_in_admin`, `max_num_in_admin`, `num_extra_on_change`, and `edit_inline`. * Serialization framework * `Serializer.get_string_value` now calls the model fields' renamed `value_to_string` methods. * Removed a special-casing of `models.DateTimeField` in `core.serializers.base.Serializer.get_string_value` that's handled by `django.db.models.fields.DateTimeField.value_to_string`. * Removed `django.core.validators`: * Moved `ValidationError` exception to `django.core.exceptions`. * For the couple places that were using validators, brought over the necessary code to maintain the same functionality. * Introduced a SlugField form field for validation and to compliment the SlugField model field (refs #8040). * Removed an oldforms-style model creation hack (refs #2160). git-svn-id: http://code.djangoproject.com/svn/django/trunk@8616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23Small edit of [8491].Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8492 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23Fixed #7499 -- Trim microseconds off rendering of form.TimeFields by default soMalcolm Tredinnick
that they validate. Previous code didn't work with microseconds anyway, so this is backwards compatible. Thanks to kevin for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23Fixed #7244 -- Allow widget overriding in subclasses for ModelChoiceField,Malcolm Tredinnick
ModelMultipleChoiceField and FilePathField. Patch from Sebastian Noack and Colin Grady. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8489 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15Fixed #8290 -- Fixed DecimalField's cleaning of values with a large number ↵Gary Wilson Jr
of decimal places, based on patch from dgouldin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8391 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-10Fixed #7830 -- Removed all of the remaining, deprecated, non-oldforms features:Gary Wilson Jr
* Support for representing files as strings was removed. Use `django.core.files.base.ContentFile` instead. * Support for representing uploaded files as dictionaries was removed. Use `django.core.files.uploadedfile.SimpleUploadedFile` instead. * The `filename`, `file_name`, `file_size`, and `chuck` properties of `UploadedFile` were removed. Use the `name`, `name`, `size`, and `chunks` properties instead, respectively. * The `get_FIELD_filename`, `get_FIELD_url`, `get_FIELD_size`, and `save_FIELD_file` methods for Models with `FileField` fields were removed. Instead, use the `path`, `url`, and `size` attributes and `save` method on the field itself, respectively. * The `get_FIELD_width` and `get_FIELD_height` methods for Models with `ImageField` fields were removed. Use the `width` and `height` attributes on the field itself instead. * The dispatcher `connect`, `disconnect`, `send`, and `sendExact` functions were removed. Use the signal object's own `connect`, `disconnect`, `send`, and `send` methods instead, respectively. * The `form_for_model` and `form_for_instance` functions were removed. Use a `ModelForm` subclass instead. * Support for importing `django.newforms` was removed. Use `django.forms` instead. * Support for importing `django.utils.images` was removed. Use `django.core.files.images` instead. * Support for the `follow` argument in the `create_object` and `update_object` generic views was removed. Use the `django.forms` package and the new `form_class` argument instead. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-30The help_text attribute in forms can be a ugettext_lazy() object, so be carefulMalcolm Tredinnick
not to trigger translations at import time. I checked other usages of help_text in form fields and model fields and there is not similar usage in __init__() methods. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8148 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26Fixed #7345 -- In [8089], I'd forgotten that urlparse.urlsplit() didn't returnMalcolm Tredinnick
something with attributes until Python 2.5. Thanks, Honza Kral and apollo13. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8093 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26Fixed #7345 -- When normalising the URLField form field, attach a trailingMalcolm Tredinnick
slash when only a host (no path) is given. Thanks, jpwatts. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8089 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22Fixed #7847 -- Removed a whole bunch of unused imports from throughout the ↵Adrian Holovaty
codebase. Thanks, julien git-svn-id: http://code.djangoproject.com/svn/django/trunk@8046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-21Fixed #7727 -- Improved the checks for import failure when using PIL. Under ↵Russell Keith-Magee
PyPy, you can import the PIL module, but when you try to use it, the underlying _imaging module will not be available. Thanks to Maciej Fijalkowski (fijal) for the report and suggested fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8016 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19Fixed #4412 -- Added support for optgroups, both in the model when defining ↵Russell Keith-Magee
choices, and in the form field and widgets when the optgroups are displayed. Thanks to Matt McClanahan <cardinal@dodds.net>, Tai Lee <real.human@mrmachine.net> and SmileyChris for their contributions at various stages in the life of this ticket. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19Fixed #7741: django.newforms is now django.forms. This is obviously a ↵Jacob Kaplan-Moss
backwards-incompatible change. There's a warning upon import of django.newforms itself, but deeper imports will raise errors. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7971 bcc190cf-cafb-0310-a4f2-bffc1f526a37