title: Django form validation: making "required" conditional?
body: <p>I'm new to Django (and Python), and am trying to figure out how to conditionalize certain aspects of form validation. In this case, there's a HTML interface to the application where the user can choose a date and a time from widgets. The <code>clean</code> method on the form object takes the values of the time and date fields and turns them back into a <code>datetime</code>.</p>
  
  <p>In addition to the HTML interface, there's also an iPhone client making calls into the application, and I'd like to pass a UNIX timestamp-style time value in.</p>
  
  <p>My form code looks like this:</p>
  
  <pre><code>class FooForm(forms.ModelForm):
      foo_date             = forms.CharField(required=True, widget=forms.RadioSelect(choices=DATE_CHOICES))
      foo_time             = forms.CharField(required=True, widget=SelectTimeWidget())
      foo_timestamp        = forms.CharField(required=False)
  </code></pre>
  
  <p>How do I make <code>foo_date</code> and <code>foo_time</code> required <strong>unless</strong> <code>foo_timestamp</code> is provided?</p>