Skip to content

Instantly share code, notes, and snippets.

@Geekfish
Created March 1, 2012 18:00
Show Gist options
  • Save Geekfish/1951707 to your computer and use it in GitHub Desktop.
Save Geekfish/1951707 to your computer and use it in GitHub Desktop.
Customer form suggestion
def clean(self):
if not self.cleaned_data['date_from'] and not self.cleaned_data['date_to']:
raise forms.ValidationError(_("At least one date field is required."))
return super(SearchByDateRangeForm, self).clean()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment