1
0
mirror of https://github.com/django/django.git synced 2025-07-07 03:09:22 +00:00

7242 Commits

Author SHA1 Message Date
Honza Král
0e3b83c315 [soc2009/model-validation] Added tests for MaxValueValidator
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:29:40 +00:00
Honza Král
6610e857e3 [soc2009/model-validation] Minor simplification of validator tests
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11192 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:29:24 +00:00
Honza Král
c1093ca87f [soc2009/model-validation] SlugField and IPAddressField now use validators.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11191 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:29:08 +00:00
Honza Král
cb7d3f2a0e [soc2009/model-validation] Validation test refactoring
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11190 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:28:41 +00:00
Honza Král
7464e4ec27 [soc2009/model-validation] Name tests migrated from doctests
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11189 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:28:23 +00:00
Honza Král
ce98a00987 [soc2009/model-validation] use assertEqual(a, b) instead of assertEqual(True, a == b) in unit tests
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11188 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:28:07 +00:00
Honza Král
2dcc99e395 [soc2009/model-validation] no need to redefine default_error_messages that don'w differ from superclass.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11187 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:27:38 +00:00
Honza Král
d23f541f10 [soc2009/model-validation] Make validators work with error messages containing paramters.
Implemented MaxValueValidator and MinValueValidator and migrated number
based form.Fields to use those instead of hardwired code. The validators
themselves are likely to change.

Covered by existing tests

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11186 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:27:20 +00:00
Honza Král
63f244f144 [soc2009/model-validation] Make sure that all validators in the same group (simple/complex) get run even if they all fail and we get all their messages.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11185 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:26:57 +00:00
Honza Král
8424c8ae6c [soc2009/model-validation] changed error_message creation to use __mro__ instead of recursive function.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11184 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:26:31 +00:00
Honza Král
69b4f2ea2e [soc2009/model-validation] renamed fields_unit to just fields
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:26:11 +00:00
Honza Král
3bab02af8b [soc2009/model-validation] Removing the doctests replaced by fields_unit
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11182 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:25:52 +00:00
Honza Král
69c8d4622e [soc2009/model-validation] module validators already imported, use it.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11181 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-05 13:25:26 +00:00
Honza Král
d628498c58 [soc2009/model-validation] Merged to trunk at r11155
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11158 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-02 16:07:15 +00:00
Honza Král
481fb86e13 [soc2009/model-validation] Minor test tweak
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11157 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-02 16:05:33 +00:00
Honza Král
6fd54a9c0d [soc2009/model-validation] some test refactoring
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11086 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-21 20:31:29 +00:00
Honza Král
6c0cc3724d [soc2009/model-validation] Added error message checking
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11085 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-21 19:57:15 +00:00
Honza Král
6306f48545 [soc2009/model-validation] Migrated FormField tests to unittests
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11084 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-21 19:24:49 +00:00
Honza Král
5ea9b72585 Merged to trunk at r11079
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11083 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-21 19:24:30 +00:00
Honza Král
98e6ab0afc [soc2009/model-validation] merged to trunk at r11032
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11038 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-18 01:37:18 +00:00
Honza Král
3a331970b4 [soc2009/model-validation] Added validators to DbFields
ComplexValidators are not yet run on the model and custom message
overring is still not in place

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11037 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-18 00:59:07 +00:00
Honza Král
d06bca726d [soc2009/model-validation] have complex validators also use error_messages if applicable
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11036 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-18 00:58:39 +00:00
Honza Král
ae581816be [soc2009/model-validation] Added code param to ValidationError and use it to override validator's messages
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11035 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-18 00:31:57 +00:00
Honza Král
d707d37048 [soc2009/model-validation] Changed EmailField to use validators
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11034 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-18 00:31:37 +00:00
Honza Král
3772800752 [soc2009/model-validation] Do not run simple validators on empty values
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11033 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-18 00:31:18 +00:00
Honza Král
eea2bfd941 [soc2009/model-validation] Added a useless import to maintain ackwards compatibility
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 00:56:16 +00:00
Honza Král
9dee3b26e5 [soc2009/model-validation] Added tests for ComplexValidators
Also the tests for validators can now verify other exceptions and not
just ValidationError

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10949 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 00:56:01 +00:00
Honza Král
8a5e9f6939 [soc2009/model-validation] Corrected a typo in format string
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10948 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 00:55:45 +00:00
Honza Král
c43edf6d76 [soc2009/model-validation] Moved execution of validators to separate method
This method (run_validators) is being run after the validate() method
finishes and doesn't produce any errors. Errors from individual
validators are aggregated and then raised together in one
ValidationError.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10947 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 00:55:27 +00:00
Honza Král
6d840d9b05 [soc2009/model-validation] Introduced ComplexValidator and changed the validator handling logic.
Field.validate() now calls all validators except for ComplexValidator
instances which are then run in the form's clean() method.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10946 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 00:55:07 +00:00
Honza Král
ca9cecb702 [soc2009/model-validation] Have model fields use EMPTY_VALUES from validators
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10945 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 00:54:45 +00:00
Honza Král
3e625f2667 [soc2009/model-validation] Merged to trunk at r10941
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10944 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-08 00:54:28 +00:00
Honza Král
7b14625d0d [soc2009/model-valition] Merged to trunk at r10914
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10916 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 14:03:10 +00:00
Honza Král
85e0c469aa [soc2009/model-validation] added validate_email validator
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10910 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:39:02 +00:00
Honza Král
ef84cf85ba [soc2009/model-validation] Added code for calling validators on form fields
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10909 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:38:39 +00:00
Honza Král
a9efb44c01 [soc2009/model-validation] FileFields migrated
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10908 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:38:23 +00:00
Honza Král
92934650f6 [soc2009/model-validation] More fields migrated to split to_python/validate
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10907 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:38:06 +00:00
Honza Král
7506471585 [soc2009/model-validation] rest of the form fields split
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10906 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:37:51 +00:00
Honza Král
eed2445d02 [soc2009/model-validation] Date based fields
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10905 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:37:36 +00:00
Honza Král
795cd55ba2 [soc2009/model-validation] DecimalField done
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10903 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:37:20 +00:00
Honza Král
08652c8501 [soc2009/model-validation] FloatField is IntegerField with a twist
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10902 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:37:04 +00:00
Honza Král
e33029cca3 [soc2009/model-validation] IntegerField migrated to split to_python/validate
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10901 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:36:49 +00:00
Honza Král
45af711718 [soc2009/model-validation] Spit FormField.clean() to to_python() and validate()
Also moved EMPTY_VALUES to validators module and implemented the change
on first Field (CharField)

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10900 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:36:33 +00:00
Honza Král
b963651223 [soc2009/model-validation] added validators param to FormField
This is still not used anywhere

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10899 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:36:16 +00:00
Honza Král
14f9493380 [soc2009/model-validation] Added first validator with tests
No usefull error message yet, validator isn't used anywhere, just a
mockup basically

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-03 02:35:59 +00:00
Honza Král
2f8f8bf531 [soc2009/model-validation] Tests now pass for validate_unique
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10886 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-02 00:38:13 +00:00
Honza Král
41bf859b67 [soc2009/model-validation] Make GetUniqueCheckTests proper testCase since it doesn't need DB
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10885 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-02 00:37:54 +00:00
Honza Král
855423542c [soc2009/model-validation] remove validate_unique from ModelForm
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10884 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-02 00:37:38 +00:00
Honza Král
ea52757c10 [soc2009/model-validation] Tests for Model._get_unique_checks
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10883 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-02 00:37:23 +00:00
Honza Král
d484d021f2 [soc2009/model-validation] just enough code editted so that validation tests pass
And we may begin our testing of the added functionality

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@10882 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-02 00:37:00 +00:00