On Sun, Apr 5, 2009 at 10:39 PM, Malcolm Tredinnick <
[email protected]> wrote:
>
> 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).
>
To be clear(since I most certainly wasn't before). I'm not necessarily
advocating that idea, merely saying that it's a false dichotomy to say he
have to pick only one way, we merely need to provide the default behavior.
>
> 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
>
>
>
> >
>
To me the simplest solution would be to pull some of that logic out of
is_valid into a "should_delete" method or something that's intended to be
subclassed if the user doesn't want the delete doesn't validate behavior by
default.
Alex
--
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---