title: Django models - how to make field from one model be dependable on field in another model (which is foreign key)?
body: <p>I'm new to Django and I'm not sure how to deal with folowing problem:</p>
  
  <p>I have models:</p>
  
  <pre><code>class Season(models.Model):
      number_of_episodes = models.IntegerField()
  class Episode(models.Model):
      season = models.ForeignKey(Season)
      number = models.IntegerField()
  </code></pre>
  
  <p>Episode number should not only be unique in season but also smaller than season's number_of_episodes.</p>