You can iterate through the forms in your formset and call is_valid()
(and optionally save()) on them based on your needs.
Since your definition of "left blank" and "invalid" could vary based
on what you're doing, it's better that you make those decisions
explicit. If Django tried to decide for yo
I have an inline formset that has max_num=3 and extra=3. The form is
displayed correctly, however, is_valid() on the formset returns a False with
error:
[{}, {'tag': [u'This field is required.']}, {'tag': [u'This field is
required.']}]
The first form has no error as the user has set some value
To clarify, by "checked" I mean there is a booleanfield and I only
want to let the user select 5 of those at a time across the inline
formset.
On Aug 12, 1:14 pm, kkerbel wrote:
> I'm trying to do some custom validation for an inlineformset. I would
> like to only allow 5 items checked across
I'm trying to do some custom validation for an inlineformset. I would
like to only allow 5 items checked across the forms in the inline
formset. What's the best way to do this? I have tried defining a
method (like a clean method for forms and formsets) but it doesn't
appear to work. Maybe I'm d
A question on forms; I had asked something similar on StackOverflow
but found the solution didn't really work for me. Let's say I have an
Article class and a Photo class, and I want to be able to attach
Photos to Articles. I create an ArticlePhotoSet class, and make it an
InlineForm in the Article
5 matches
Mail list logo