summaryrefslogtreecommitdiff
path: root/django/core/validators.py
AgeCommit message (Collapse)Author
2007-09-15Fixed #3036 -- Fixed some doctest strings that were failing. Thanks to pterk ↵Russell Keith-Magee
for the original patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6268 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed #3848 -- Added more comprehensive checks to ImageField validation, ↵Russell Keith-Magee
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-11Fixed #4478 -- Added a catch for an error thrown by PIL when attempting to ↵Russell Keith-Magee
validate MS OLE files. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6096 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-08Fixed imports to adhere to PEP 8 and stripped trailing whitespace.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6068 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-08Fixed #5232 -- Fixed the validation of `DecimalField` so that the negative ↵Gary Wilson Jr
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-08-15Fixed #5156 -- Added some translation calls to a couple of missed words. ↵Malcolm Tredinnick
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-12Fixed #5011 -- Fixed usage of ungettext in hasNoProfanities validator. ↵Adrian Holovaty
Thanks, tzellman@gmail.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@5864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-06Fixed #5071 -- Fixed 'global name ugettext is not defined' error in ↵Adrian Holovaty
django.core.validators. Thanks, Marco Bonetti git-svn-id: http://code.djangoproject.com/svn/django/trunk@5811 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-13Fixed #4807 -- Fixed a couple of corner cases in decimal form input validation.Malcolm Tredinnick
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-10Fixed #4812 -- Fixed an octal escape in regular expression that is used in ↵Gary Wilson Jr
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-04Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick
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-05-21Fixed #2365, #3324 -- Renamed FloatField to DecimalField and changed the codeMalcolm Tredinnick
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-04-26Fixed #4040 -- Changed uses of has_key() to "in". Slight performanceMalcolm Tredinnick
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-03-12Fixed #3410 -- Edited a few i18n markups for completeness and to remove someMalcolm Tredinnick
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-11Fixed some i18n markup on date error messages. Thanks, Bastian Kleineidam. RefsMalcolm Tredinnick
#3069. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4702 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-25Fixed #2104: allow somewhat nicer error messages in ↵Jacob Kaplan-Moss
RequiredIfOtherFieldEquals validator. Thanks, Steven Armstrong git-svn-id: http://code.djangoproject.com/svn/django/trunk@4577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11Revert [4485] in order to fix accidental mod_python breakage. Refs #2920.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11Refs #2920 -- Replaced implicit uses of _() with explicit imports or calls ↵Russell Keith-Magee
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
2006-11-07Fixed #2364: added NumberIsInRange validator. Thanks, Matt McClanahan.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4039 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07Fixed #2934: greatly improved the accuracy if the isExistingURL check. Also ↵Jacob Kaplan-Moss
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-09-26Fixed #2760 -- Fixed FloatField validator right (take two!) for negativeMalcolm Tredinnick
float amounts. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-25Small improvements to profanities-to-settings move from [3784]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3837 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-24Fixed #2674 -- Added stricter date validation so that things like 2006-11-31Malcolm Tredinnick
are caught. Thanks, Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3815 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-22Fixed #2789 -- Corrected typo from r3788.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3796 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-22Fixed #2760 -- Fixed validation of negative float amounts in forms. Thanks,Malcolm Tredinnick
James Bennett and Eddy Mulyono. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3788 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-22Fixed #2678 -- Moved the list of profanities for the hasNoProfanities validatorMalcolm Tredinnick
into global_settings. Patch from Matt Croydon. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3784 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-21Fixed #2577 -- Made isSlug() validator translation-aware. Thanks for the ↵Adrian Holovaty
patch, henrik_kroeger@arcor.de git-svn-id: http://code.djangoproject.com/svn/django/trunk@3634 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-10Fixed #2312 -- E-mail validator now accepts TLDs up to 6 characters longAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-19Fixed #1088 - Correctly detect when a float with too many digits before theMalcolm Tredinnick
decimal point is passed in. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3142 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-08Fixed #2109 -- Convert old-style classes to new-style classes throughout ↵Adrian Holovaty
Django. Thanks, Nicola Larosa git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-03Eliminated lots of mutable default arguments (since they are bugsLuke Plant
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-01Fixed #2045 - TypeError thrown if a form does not have the correct enctype ↵Luke Plant
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-05-31Fixed #2049 -- Made isValidEmail validator wider in scope. Thanks, mir@noris.deAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3026 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-02MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly ↵Adrian Holovaty
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-03-28Fixed #1550 -- Changed MatchesRegularExpression validator to use .search(), ↵Adrian Holovaty
not .match(). Thanks, Gary Wilson git-svn-id: http://code.djangoproject.com/svn/django/trunk@2588 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-02-22Fixed #1275 and #1288 -- Change e-mail address validator regular expression ↵Adrian Holovaty
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-18Fixed #721 -- isAlphaNumericURL validator now allows dashesAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-02-10Improved url_re in django.core.validators to accept https. Thanks, Eric HsuAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2299 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-01-27Fixed #1070 -- Improved date validation to limit it to dates 1900 and up.Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2134 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-12-07Fixed #1009 -- Fixed small typo in HasAllowableSize validator. Thanks, bsoltaniAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1564 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-22Fixed use of "_" in RelaxNGCompact validator which was conflicting with ↵Jacob Kaplan-Moss
gettext tag git-svn-id: http://code.djangoproject.com/svn/django/trunk@1340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-21fixed a bug with some validators that used parameterized gettext_lazy ↵Georg Bauer
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-21fixes #753 - ValidationError and CriticalValidationError now accept both ↵Georg Bauer
strings and promises from gettext_lazy git-svn-id: http://code.djangoproject.com/svn/django/trunk@1328 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-12Fixed #778 -- Improved isExistingURL validator not to raise ValidationError ↵Adrian Holovaty
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-06Fixed #281 -- Made e-mail address validation much more strict and accurate.Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-06Fixed #737 -- Changed validators.isValidIPAddress4 to use a single regex. ↵Adrian Holovaty
Thanks, mattimustang git-svn-id: http://code.djangoproject.com/svn/django/trunk@1093 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-05Fixed #734 -- Fixed namespace bug in validators.isValidIPAddress4. Thanks, ↵Adrian Holovaty
Hugo and mflanagan git-svn-id: http://code.djangoproject.com/svn/django/trunk@1091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-11-04Merged i18n branch into the trunk! Fixes #65, and perhaps some others. NB: ↵Jacob Kaplan-Moss
this means that the i18n branch is now obsolete and will be made read-only. git-svn-id: http://code.djangoproject.com/svn/django/trunk@1068 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-10-20Fixed #317 -- SlugField now accepts hyphens. Thanks, SuneAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2005-09-27Moved JING from django.core.validators into settings where it belongs. ↵Jacob Kaplan-Moss
Fixes #568. git-svn-id: http://code.djangoproject.com/svn/django/trunk@712 bcc190cf-cafb-0310-a4f2-bffc1f526a37