Commit Graph

64 Commits

Author SHA1 Message Date
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
Gary Wilson Jr c2ba59fc1d Removed oldforms, validators, and related code:
* 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-27 07:19:44 +00:00
Adrian Holovaty df2b19cc17 Fixed #1443 -- Django's various bits now support dates before 1900. Thanks to SmileyChris, Chris Green, Fredrik Lundh and others for patches and design help
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7946 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 03:47:27 +00:00
Malcolm Tredinnick 58a68723b3 Changed a couple of old-style validators to remove some deprecation warnings
when using ImageFields, etc, in the admin interface. Cosmetic only. Refs #7608.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7837 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-05 02:14:34 +00:00
Malcolm Tredinnick 50ecd75379 Fixed #6492 -- Added bullet-proofing to isValidFloat validator. Thanks, Bastian Kleineidam.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7258 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-17 14:05:43 +00:00
Russell Keith-Magee 84e824fbbf Fixed #3036 -- Fixed some doctest strings that were failing. Thanks to pterk for the original patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6268 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 08:29:56 +00:00
Russell Keith-Magee 63dd4f5322 Fixed #3848 -- Added more comprehensive checks to ImageField validation, checking for image truncation or corruption. Thanks to Andrew C <andrewc-djangotrac1@piffle.org> for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6175 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 07:18:27 +00:00
Russell Keith-Magee 7115465afa Fixed #4478 -- Added a catch for an error thrown by PIL when attempting to validate MS OLE files.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6096 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-11 13:13:35 +00:00
Gary Wilson Jr b0e173ae3f Fixed imports to adhere to PEP 8 and stripped trailing whitespace.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6068 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-08 19:26:15 +00:00
Gary Wilson Jr 7e57576ff7 Fixed #5232 -- Fixed the validation of `DecimalField` so that the negative sign is not counted as a digit. Thanks, Andrew Durdin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-08 19:24:46 +00:00
Malcolm Tredinnick ce151bb8e4 Fixed #5156 -- Added some translation calls to a couple of missed words. Based on a patch from dAniel hAhler.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5895 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-15 12:09:32 +00:00
Adrian Holovaty f128c7bbb7 Fixed #5011 -- Fixed usage of ungettext in hasNoProfanities validator. Thanks, tzellman@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-12 03:27:57 +00:00
Adrian Holovaty 3c733bb690 Fixed #5071 -- Fixed 'global name ugettext is not defined' error in django.core.validators. Thanks, Marco Bonetti
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5811 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-06 05:07:38 +00:00
Malcolm Tredinnick 92f54aff7a Fixed #4807 -- Fixed a couple of corner cases in decimal form input validation.
Based on a suggestion from Chriss Moffit.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-13 09:09:59 +00:00
Gary Wilson Jr 0927ab92b2 Fixed #4812 -- Fixed an octal escape in regular expression that is used in the `isValidEmail` validator, thanks batchman@free.fr.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5640 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-10 03:26:26 +00:00
Malcolm Tredinnick 953badbea5 Merged Unicode branch into trunk (r4952:5608). This should be fully
backwards compatible for all practical purposes.

Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04 12:11:04 +00:00
Malcolm Tredinnick 92c35a0617 Fixed #2365, #3324 -- Renamed FloatField to DecimalField and changed the code
to return Decimal instances in Python for this field. Backwards incompatible
change.

Added a real FloatField (stores floats in the database) and support for
FloatField and DecimalField in newforms (analogous to IntegerField).

Included decimal.py module (as django.utils._decimal) from Python 2.4. This is
license compatible with Django and included for Python 2.3 compatibility only.

Large portions of this work are based on patches from Andy Durdin and Jorge
Gajon.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@5302 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-21 01:29:58 +00:00
Malcolm Tredinnick 439cb4047f Fixed #4040 -- Changed uses of has_key() to "in". Slight performance
improvement and forward-compatible with future Python releases. Patch from Gary
Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-26 13:30:48 +00:00
Malcolm Tredinnick b1eea1af40 Fixed #3410 -- Edited a few i18n markups for completeness and to remove some
warnings from recent gettext versions. Refs #3704. Thanks, Michael Radziej,
mirrorballu2@gmail.com and baptiste.goupil@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@4704 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-12 08:35:15 +00:00
Malcolm Tredinnick 5c2e83eef5 Fixed some i18n markup on date error messages. Thanks, Bastian Kleineidam. Refs
#3069.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@4702 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-11 10:37:33 +00:00
Jacob Kaplan-Moss cef2239086 Fixed #2104: allow somewhat nicer error messages in RequiredIfOtherFieldEquals validator. Thanks, Steven Armstrong
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-25 17:16:38 +00:00
Malcolm Tredinnick 6c4757729b Revert [4485] in order to fix accidental mod_python breakage. Refs #2920.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11 23:50:35 +00:00
Russell Keith-Magee 0e924c70b1 Refs #2920 -- Replaced implicit uses of _() with explicit imports or calls to gettext(). At some point post 0.96, we need to remove the calls that put _ into the builtins.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4485 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11 06:20:52 +00:00
Jacob Kaplan-Moss 3a0733e12c Fixed #2364: added NumberIsInRange validator. Thanks, Matt McClanahan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4039 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07 04:29:07 +00:00
Jacob Kaplan-Moss 4d59730fad Fixed #2934: greatly improved the accuracy if the isExistingURL check. Also introduced a new setting, URL_VALIDATOR_USER_AGENT, which is the User-Agent that the validator will use to check for URL existance. Thanks, Jeremy.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4035 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07 02:20:08 +00:00
Malcolm Tredinnick 1fc62f0fd6 Fixed #2760 -- Fixed FloatField validator right (take two!) for negative
float amounts.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-26 01:57:26 +00:00
Adrian Holovaty 321a59a36a Small improvements to profanities-to-settings move from [3784]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3837 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-25 17:38:35 +00:00
Malcolm Tredinnick a6a4e9b244 Fixed #2674 -- Added stricter date validation so that things like 2006-11-31
are caught. Thanks, Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3815 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-24 12:09:32 +00:00
Malcolm Tredinnick aa30761d51 Fixed #2789 -- Corrected typo from r3788.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3796 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-22 13:33:43 +00:00
Malcolm Tredinnick 14be60c4cb Fixed #2760 -- Fixed validation of negative float amounts in forms. Thanks,
James Bennett and Eddy Mulyono.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3788 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-22 03:42:31 +00:00
Malcolm Tredinnick b46a093c45 Fixed #2678 -- Moved the list of profanities for the hasNoProfanities validator
into global_settings. Patch from Matt Croydon.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3784 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-22 02:48:19 +00:00
Adrian Holovaty cccbe23006 Fixed #2577 -- Made isSlug() validator translation-aware. Thanks for the patch, henrik_kroeger@arcor.de
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3634 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-21 17:43:34 +00:00
Adrian Holovaty b98972e1c9 Fixed #2312 -- E-mail validator now accepts TLDs up to 6 characters long
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-10 02:32:54 +00:00
Malcolm Tredinnick c0ea3284d7 Fixed #1088 - Correctly detect when a float with too many digits before the
decimal point is passed in.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3142 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-19 01:09:00 +00:00
Adrian Holovaty 2abfd5dd58 Fixed #2109 -- Convert old-style classes to new-style classes throughout Django. Thanks, Nicola Larosa
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-08 05:00:13 +00:00
Luke Plant 9b86db9bf2 Eliminated lots of mutable default arguments (since they are bugs
waiting to happen and are memory leaks too).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3070 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-03 13:37:34 +00:00
Luke Plant dbcd2fe985 Fixed #2045 - TypeError thrown if a form does not have the correct enctype for uploading
files.  It throws a ValidationError now, as it should.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3048 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-01 20:47:34 +00:00
Adrian Holovaty 1bf991abb3 Fixed #2049 -- Made isValidEmail validator wider in scope. Thanks, mir@noris.de
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3026 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-31 18:08:28 +00:00
Adrian Holovaty f69cf70ed8 MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-02 01:31:56 +00:00
Adrian Holovaty 341d1eb022 Fixed #1550 -- Changed MatchesRegularExpression validator to use .search(), not .match(). Thanks, Gary Wilson
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2588 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-03-28 21:39:15 +00:00
Adrian Holovaty 0bf0b6d896 Fixed #1275 and #1288 -- Change e-mail address validator regular expression to be faster, simpler and accept subdomains
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2367 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-02-22 17:13:08 +00:00
Adrian Holovaty cf528aa420 Fixed #721 -- isAlphaNumericURL validator now allows dashes
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-02-18 22:36:16 +00:00
Adrian Holovaty d8b4d29004 Improved url_re in django.core.validators to accept https. Thanks, Eric Hsu
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2299 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-02-10 15:38:54 +00:00
Adrian Holovaty e15567bf58 Fixed #1070 -- Improved date validation to limit it to dates 1900 and up.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2134 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-01-27 16:05:00 +00:00
Adrian Holovaty 374a6eaa4c Fixed #1009 -- Fixed small typo in HasAllowableSize validator. Thanks, bsoltani
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1564 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-12-07 05:13:18 +00:00
Jacob Kaplan-Moss b6ddc9d3c1 Fixed use of "_" in RelaxNGCompact validator which was conflicting with gettext tag
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-22 03:39:39 +00:00
Georg Bauer a87d43f809 fixed a bug with some validators that used parameterized gettext_lazy strings and forced them to the default language because of the % operator. Now lazy string interpolation is used.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1330 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-21 11:10:19 +00:00
Georg Bauer e4e28d907a fixes #753 - ValidationError and CriticalValidationError now accept both strings and promises from gettext_lazy
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1328 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-21 10:41:54 +00:00
Adrian Holovaty 0a74c68eee Fixed #778 -- Improved isExistingURL validator not to raise ValidationError for URLs that exist but require authorization. Thanks for the report, lakin wrecker.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-12 20:25:47 +00:00
Adrian Holovaty a218cf5798 Fixed #281 -- Made e-mail address validation much more strict and accurate.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-06 22:59:18 +00:00