On Sun, 2009-04-05 at 18:03 -0400, Alex Gaynor wrote:
[...]
> Sure we can have it both ways, how about a constructor option,
> "validate_deletions". With the current(that is no validation)
> behavior as the default.
No, we really can't. Having an option for every single possibility isn't
a good idea. It leads to option explosion and a very necessary
implementation ("happens to be technically possible" doesn't mean
"actually possible in practice", since it's not practical).
There's usually one predominantly correct behaviour in situations like
this. the fact that some people sometimes don't want that isn't a reason
to add Yet Another Option -- after all, they're not obligated to use
formsets or the admin or anything like that, so they already have a
choice to just use plain Python if they really want something else. In
this case, it sounds like people are using an implementation side-effect
to do something unintended and whilst Joseph's efforts to work with that
for a few weeks longer are admirable, long-term it's a problem that we
should solve with a proper API if the use-case is reasonable (which it
seems like it does). Preserving the undesired side-effect isn't a good
technical approach.
I agree with Joseph here that validation errors shouldn't stop deletion,
since you've said you want to *delete* the form and the data no longer
has a meaning. Data that is about to cease to exist shouldn't play a
role in validation -- it's un-data; wouldn't voom is you put 50,000
volts through it, etc.
The optional piece here is allowing for a form to be prevented from
deletion in the first place, not post hoc.
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---