Guest User

Untitled

a guest
May 15th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. # Forms.py Required at laest one address to a Generic Relation Inline Formset
  2. class AddressInlineFomrset(BaseGenericInlineFormSet):
  3.    
  4.     def clean(self):
  5.         self.validate_unique()
  6.         if any(self.errors):
  7.             return
  8.         if not self.forms[0].has_changed():
  9.             raise forms.ValidationError("At least one address is required.")
Advertisement
Add Comment
Please, Sign In to add comment