Re: Using form validation to prevent deletion no longer works (after rev 10206/ticket #9587)

2009-04-05 Thread Dan Tallis

2009/4/5 Karen Tracey :
> Forgot the link to that other ticket [1]:
>
> http://code.djangoproject.com/ticket/10711

Thanks for the response, Karen.  I've posted to django-developers.  I
think ticket 10711 is only very loosely related.

Dan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Using form validation to prevent deletion no longer works (after rev 10206/ticket #9587)

2009-04-05 Thread Karen Tracey
Forgot the link to that other ticket [1]:

http://code.djangoproject.com/ticket/10711

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Using form validation to prevent deletion no longer works (after rev 10206/ticket #9587)

2009-04-05 Thread Karen Tracey
On Sun, Apr 5, 2009 at 9:40 AM, Dan Tallis  wrote:

>
> In my application I have a formset with can_delete.  Some custom
> validation is performed on submit, to determine whether the forms
> selected by the user for deletion can be deleted -- i.e. I have a
> custom clean() method on the form to decide whether deletion is
> permitted (based on various bits of dynamic state), which may raise a
> ValidationError to prevent it.
>
[snip remainder]

Not sure I fully understand your use case, but it sounds like this change
may have introduced an unanticipated backwards incompatibility, and one that
could lead to unexpected data deletion, which seems bad.  I suggest you
re-post this on django-developers to make all the right people see it.  It's
appropriate for there since you're discussing the effects of some recent dev
changes.  Also you might want to take a look at ticket #10711 [1] and see if
what's being proposed there would be of any use to you.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Using form validation to prevent deletion no longer works (after rev 10206/ticket #9587)

2009-04-05 Thread Dan Tallis

In my application I have a formset with can_delete.  Some custom
validation is performed on submit, to determine whether the forms
selected by the user for deletion can be deleted -- i.e. I have a
custom clean() method on the form to decide whether deletion is
permitted (based on various bits of dynamic state), which may raise a
ValidationError to prevent it.

Up to rev 10206 (which relates to ticket #9587), this worked nicely,
giving me exactly the user interface I want.  But rev 10206 has
changed things: the formset is_valid now returns True for deleted
forms even if they have validation errors, on the grounds that (to
quote) "formset with can_delete shouldn't require deleted forms to
validate".

This means that the formset is treated as valid by my view code, so it
goes ahead and tries to save the formset, whereas what I want (and
what happened prior to rev 10206) was that the form was re-displayed
to the user with a nice error message.

I understand the thinking behind #9587, but I wonder whether this
consequence -- that it's no longer (straightforwardly) possible to use
the validation mechanism to prevent deletion -- was intended.  (There
isn't much discussion in #9587 for me to tell.)

If it was intended, any suggestions on how I can best alter my
application to achieve what I want?

Regards

Dan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---