Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Forms.py Required at laest one address to a Generic Relation Inline Formset
- class AddressInlineFomrset(BaseGenericInlineFormSet):
- def clean(self):
- self.validate_unique()
- if any(self.errors):
- return
- if not self.forms[0].has_changed():
- raise forms.ValidationError("At least one address is required.")
Advertisement
Add Comment
Please, Sign In to add comment