Commit Graph

110 Commits

Author SHA1 Message Date
Claude Paroz 02b0106d43 Fixed #20781 -- Fixed _has_changed regression with MultiValueField
Thanks Tim Graham for the report.
2013-07-22 09:06:07 +02:00
Simon Charette 415a36947c Fixed #20765 -- Set small values of `step` using exponential notation.
Browsers parse small factors of 10 as 0 under decimal notation.

Thanks to Trac alias matklad for the report and Claude Paroz for the review.
2013-07-19 23:31:15 -04:00
Simon Charette 04628e2016 Fixed #20630 -- Removed `maxlength` attribute from `NumberInput`.
This attribute is only allowed on inputs of type "text", "search", "url",
"tel", "email", or "password".

Thanks to yoyoma for the report and @bmispelon for the review.
2013-06-20 10:59:41 -04:00
Loic Bistuer ee77d4b253 Fixed #20199 -- Allow ModelForm fields to override error_messages from model fields 2013-06-18 08:01:17 -04:00
Loic Bistuer f34cfec0fa Refactored ValidationError to allow persisting error params and error codes as the exception bubbles up 2013-06-18 08:01:17 -04:00
Baptiste Mispelon dc9c359546 Fixed #20594 -- Add validation to models.SlugField.
Thanks carbonXT for the report.
2013-06-13 13:31:57 -04:00
Tome Cvitan caf56ad174 Fixed #20440 -- Ensured CharField's max_length/min_length are integers 2013-05-18 22:30:24 +02:00
Deni Bertovic 186ec21a3d Added stripping of whitespace for SlugField and URLField 2013-05-18 16:06:08 +02:00
Daniel Lindsley 33793f7c3e Fixed #19934 - Use of Pillow is now preferred over PIL.
This starts the deprecation period for PIL (support to end in 1.8).
2013-05-14 19:32:04 -07:00
Claude Paroz be9ae693c4 Fixed #17840 -- Generalized named placeholders in form error messages
Also fixed plural messages for DecimalField.
2013-04-13 18:55:50 +02:00
Claude Paroz 066bf42675 Removed forced typecasting of help_text/label Field arguments
In any case, setting those variables to non-ascii utf-8 bytestrings
is now considered a programming error.
2013-03-25 21:38:21 +01:00
Carny Cheng aaec4f2bd8 Fixed #18839 - Field.__init__() now calls super(). 2013-03-20 16:20:57 -07:00
konarkmodi bc4111ba68 Fixed #18003 -- Preserved tracebacks when re-raising errors.
Thanks jrothenbuhler for draft patch, Konark Modi for updates.
2013-03-19 15:42:39 -07:00
Claude Paroz 2f121dfe63 Fixed #17051 -- Removed some 'invalid' field error messages
When the 'invalid' error message is set at field level, it masks
the error message raised by the validator, if any.
2013-03-14 17:03:43 +01:00
Claude Paroz 9883551d50 Fixed #20039 -- Fixed has_changed form detection for required TypedChoiceFields
Thanks Florian Apolloner for the report and the review.
Also fixes #19643.
2013-03-14 14:49:07 +01:00
Claude Paroz 4cccb85e29 Fixed #19997 -- Added custom EMPTY_VALUES to form fields
Thanks Loic Bistuer for the report and the patch.
2013-03-07 15:22:03 +01:00
Claude Paroz 892bc91cb0 Fixed #16612 -- Improved has_changed detection for localized field values
Thanks Simon Charette for the review.
2013-03-01 09:35:04 +01:00
Florian Apolloner 5ae0c933a8 Fixed errors introduced in 21f333bcef. Refs #17751 2013-02-23 18:43:34 +01:00
Erik Romijn 21f333bcef Fix #17751: Added stripping of whitespace for IPAddressField/GenericIPAddressField 2013-02-23 14:44:57 +01:00
Claude Paroz 7ec2a21be1 Fixed #19686 -- Added HTML5 number input type
Thanks Simon Charette for his help on the patch. Refs #16630.
2013-02-23 10:18:08 +01:00
Claude Paroz fc8efc2d9e Fixed #19034 -- Added proper i18n pluralization for max/min length validation messages
This was made possible by commit 3f1a0c0040. Thanks Evil Clay
for the report and Alexey Boriskin his work on the ticket.
2013-01-30 21:44:14 +01:00
Claude Paroz f7394d2c32 Added HTML5 url input type
Refs #16630.
2013-01-28 22:11:00 +01:00
Claude Paroz 4f16376274 Added HTML5 email input type
Refs #16630.
2013-01-28 22:10:50 +01:00
Claude Paroz 4b3f7110ae Fixed #16123 -- Ensured strptime receive proper string type
strptime generates an UnicodeEncodeError when using a non-ascii
unicode string on Python 2.
2013-01-26 20:53:09 +01:00
Claude Paroz d18893d5ce Moved BooleanField 'required' validation in validate() 2013-01-26 16:45:29 +01:00
Claude Paroz ebb504db69 Moved has_changed logic from widget to form field
Refs #16612. Thanks Aymeric Augustin for the suggestion.
2013-01-25 20:50:46 +01:00
Adrien Lemaire 2c8267bf3d Fixed #17899 -- Rewrote [Ee]-mail to [Ee]mail 2012-09-26 14:14:51 +02:00
Aymeric Augustin 3174b5f2f5 Fixed #18982 - Caught TypeError in DateField.clean
Thanks gwahl at fusionbox com.
2012-09-23 13:27:01 +02:00
Claude Paroz f1bdfbd24b Document and test 'type' usage in Widget attrs
Refs #16630.
2012-09-10 19:31:11 +02:00
Aymeric Augustin c5ef65bcf3 [py3] Ported django.utils.encoding.
* Renamed smart_unicode to smart_text (but kept the old name under
  Python 2 for backwards compatibility).
* Renamed smart_str to smart_bytes.
* Re-introduced smart_str as an alias for smart_text under Python 3
  and smart_bytes under Python 2 (which is backwards compatible).
  Thus smart_str always returns a str objects.
* Used the new smart_str in a few places where both Python 2 and 3
  want a str.
2012-08-07 12:00:22 +02:00
Florian Apolloner b1d4634686 Fixed second security issue in image uploading. Disclosure and release forthcoming. 2012-07-30 21:57:22 +02:00
Aymeric Augustin 0d914d08a0 [py3] Updated urllib/urllib2/urlparse imports.
Lots of functions were moved. Use explicit imports in all cases
to keey it easy to identify where the functions come from.
2012-07-22 09:29:55 +02:00
Aymeric Augustin bdca5ea345 [py3] Replaced unicode/str by six.text_type/bytes. 2012-07-22 09:29:54 +02:00
Aymeric Augustin 3cb2457f46 [py3] Replaced basestring by six.string_types. 2012-07-22 09:29:54 +02:00
Claude Paroz 4a103086d5 Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.
Thanks Vinay Sajip for the support of his django3 branch and
Jannis Leidel for the review.
2012-06-07 18:08:47 +02:00
Julien Phalip f6fc83c975 Fixed #18409 -- Made RegexField work with unicode characters. 2012-05-31 11:45:35 -07:00
Claude Paroz eb0140bddc Hidden __pycache__ dirs for FilePathField. Refs #17393.
This will be tested as soon as tests will run under Python 3. Patch
taken from Vinay Sajip's Python 3 branch.
2012-05-16 23:15:49 +02:00
Claude Paroz d7dfab59ea Replaced cStringIO.StringIO by io.BytesIO.
Also replaced StringIO.StringIO by BytesIO in some other appropriate
places. StringIO is not available in Python 3.
2012-05-05 21:41:44 +02:00
Claude Paroz 3904b74a3f Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-04-29 20:57:15 +02:00
Alex Gaynor 3c5ff9d703 Fixed #5893 -- Added a flag to FilePathField to allow listing folders, in addition to regular files. Thank you to Brian Rosner, for encouraging me to first contribute to Django 4 years ago.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17925 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-04-22 14:44:08 +00:00
Claude Paroz 5e047ed859 Removed pre-2.6 compatibility code in date-based form fields. Refs #9459.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17870 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-04-05 14:49:02 +00:00
Aymeric Augustin 9ed6e08ff9 Removed deprecated URLField.verify_exists.
The deprecation schedule was slightly accelerated because of possible security ramifications.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-31 13:55:03 +00:00
Claude Paroz 159d1be656 Fixed #11150 -- Removed dependency on cStringIO in ImageField validation. Thanks vvd for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-29 16:49:59 +00:00
Jannis Leidel 9c045d00dc Fixed #14184 -- Enabled running the validators in MultiValueFields. Thanks, paulcollins.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17430 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-04 12:48:12 +00:00
Aymeric Augustin 9b1cb755a2 Added support for time zones. Thanks Luke Plant for the review. Fixed #2626.
For more information on this project, see this thread:
http://groups.google.com/group/django-developers/browse_thread/thread/cf0423bbb85b1bbf



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-18 13:01:06 +00:00
Julien Phalip a6ccc8cc06 Fixed #15912 -- Ensured that `forms.CharField.widget_attrs()` always returns a dictionary. Thanks to tsabi and rubyruy for the report and to mmcnickle and prestontimmons for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17096 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-15 09:36:08 +00:00
Karen Tracey 0db571b417 Fixed #17134: Corrected Python 2.5 fallback code for parsing microseconds in time values. Thanks aaugustin and jcd.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17092 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-13 00:43:02 +00:00
Julien Phalip 90d3697417 Fixed #17125 -- Made it possible to change a `RegexField`'s regular expression validator after it has been initialized. Thanks to Claude Paroz for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17076 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-07 07:41:24 +00:00
Carl Meyer 7a718f0f3a Fixed #17127 -- Made field validators list independent per form instance. Thanks claudep for report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-28 14:38:41 +00:00
Alex Gaynor 544a8372fd Remove several more relative imports.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17007 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-17 16:56:18 +00:00