#9587: formset with can_delete shouldn't require deleted forms to validate
------------------------------------------------------------+---------------
Reporter: Daniel Pope <[email protected]> | Owner:
nobody
Status: new | Milestone:
Component: Forms | Version:
1.0
Resolution: | Keywords:
formset can_delete
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------------------------------+---------------
Changes (by kratorius):
* keywords: => formset can_delete
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
I see two possible solutions here:
1. we don't validate the single form
2. we validate the form, but the formset's will be valid even if the
field that is going to be deleted is invalid
I'm more inclined to go with the second option since if the user checks
the deletion checkbox but other fields are invalid, we should redisplay
the whole formset and show eventual errors.[[BR]]
Anyway I can't see a clean way of fixing this issue. I wrote a patch, but
I don't like the solution mainly because the only way I have to know if
the form has to be deleted is to check for the {{{DELETE}}} string in the
initial data (I can't access {{{form.cleaned_data}}} since if the form has
errors {{{cleaned_data}}} gets deleted).
--
Ticket URL: <http://code.djangoproject.com/ticket/9587#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---