Django

Code

Ticket #23 (new)

Opened 3 years ago

Last modified 1 month ago

Add support for ValidationWarning

Reported by: adrian Assigned to: nobody
Milestone: post-1.0 Component: Forms
Version: 1.0-alpha-2 Keywords:
Cc: paul.bowsher@gmail.com., mir@noris.de, cmawebsite@gmail.com Triage Stage: Accepted
Has patch: 1 Needs documentation: 1
Needs tests: 1 Patch needs improvement: 1

Description

We've talked in the past about how useful it would be to let certain validators throw ValidationWarning? instead of ValidationError?. A ValidationWarning?, when thrown, would still redisplay the admin form but display an additional checkbox above the field. If that checkbox is checked when the form is submitted, the error is ignored.

The change would have to be made in django/core/formfields.py.

Attachments

warnings_as_list_partial.patch (2.5 kB) - added by CollinAnderson on 01/03/08 21:52:46.
Patch against [6992] that has a partial implemtation of keeping track of Warnings as a list
form-warnings.diff (13.1 kB) - added by Alex on 12/09/08 15:45:40.
some initial work
form-warnings.2.diff (12.2 kB) - added by Alex on 12/12/08 11:29:39.
removed the nasty warning system, instead pass a callable to the clean functions

Change History

09/01/05 18:12:25 changed by adrian

  • component changed from Core framework to Validators.

10/07/05 09:29:09 changed by Boffbowsh

  • cc set to paul.bowsher@gmail.com.

I'll be needing this soon, so I'll try and get something up together

06/09/06 09:33:25 changed by mir@noris.de

  • cc changed from paul.bowsher@gmail.com to paul.bowsher@gmail.com., mir@noris.de.

This would then be limited to admin forms, do I understand this correctly?

01/18/07 02:27:59 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Design decision needed.

09/13/07 07:10:14 changed by russellm

  • stage changed from Design decision needed to Accepted.

Safe to assume that if Adrian proposed the idea, it has been accepted.

12/13/07 10:44:43 changed by anonymous

  • owner changed from nobody to anonymous.
  • status changed from new to assigned.

12/13/07 10:47:11 changed by jimmyj_in

  • owner changed from anonymous to jimmyj_in.
  • status changed from assigned to new.

12/13/07 14:24:16 changed by jimmyj_in

  • owner changed from jimmyj_in to nobody.

01/03/08 21:51:17 changed by CollinAnderson

  • cc changed from paul.bowsher@gmail.com., mir@noris.de to paul.bowsher@gmail.com., mir@noris.de, cmawebsite@gmail.com.
  • needs_better_patch set to 1.
  • has_patch set to 1.
  • component changed from Validators to django.newforms.

It seems to me that these ValidationWarnings? could not be regular Python exceptions. Python exceptions will stop running the validation code after a ValidationWarning? is thrown, so there could be a ValidationError? that would be thrown later, but instead it would appear that the field only has a warning and no errors. Instead I propose that, if we still want this feature, we use a list of warnings instead.

Is it safe to assume this applies to newforms, and not the database validation?

I have a partial implementation of this in newforms.

01/03/08 21:52:46 changed by CollinAnderson

  • attachment warnings_as_list_partial.patch added.

Patch against [6992] that has a partial implemtation of keeping track of Warnings as a list

06/16/08 12:09:51 changed by mrts

  • milestone set to post-1.0.

Marking as post-1.0 as this is not essential for 1.0.

09/16/08 05:53:06 changed by anonymous

  • needs_docs set to 1.
  • version set to 1.0-alpha-2.
  • component changed from Forms to Authentication.
  • needs_tests set to 1.

12/06/08 12:52:04 changed by Alex

  • component changed from Authentication to Forms.

I've begun work on this, you can follow it here: http://github.com/alex/django/tree/local/validation-warning

12/09/08 15:45:40 changed by Alex

  • attachment form-warnings.diff added.

some initial work

12/12/08 11:29:39 changed by Alex

  • attachment form-warnings.2.diff added.

removed the nasty warning system, instead pass a callable to the clean functions


Add/Change #23 (Add support for ValidationWarning)




Change Properties
Action