Re: delete in formset by clearing fields instead of checkbox

2009-03-17 Thread akaihola
Just in case anyone decides to use the code I posted earlier in this thread, there's one bug: the str() call needs to be replaced with a unicode() call to prevent failure with non-ASCII input. --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: delete in formset by clearing fields instead of checkbox

2009-03-13 Thread akaihola
Here is what I came up with. I had to override ModelForm as well to get rid of validation errors in emptied forms. This solution works in my use case where I only have CharFields and IntegerFields. It's not as simple as I had wished. Can it be? class DeleteIfEmptyModelForm(ModelForm): """

Re: delete in formset by clearing fields instead of checkbox

2009-03-12 Thread Alex Gaynor
On Thu, Mar 12, 2009 at 5:34 PM, akaihola wrote: > > I have an inline formset with three CharFields in each form of a child > object. For usability reasons, I'd like deleting to happen when all > fields of a form are blank (or whitespace-only) instead of using a > delete checkbox. > > I'm looking