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
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):
"""
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
3 matches
Mail list logo