title: django 'null value in column'
body: <p>I try to save user's birth date, but get "null value in column "dob" violates not-null constraint" error.</p>
  
  <p>models.py:</p>
  
  <pre><code>class Profile(models.Model):
    user = models.OneToOneField(User, unique=True)
  
    nickname = models.CharField(max_length=32)
    dob = models.DateField(null=False)
    sex = models.BooleanField(null=False)
  </code></pre>
  
  <p>Here i try to generate random users:</p>
  
  <pre><code>def create_random_users(userCount=1000):
    random.seed()
  
    for i in range(0, userCount):
      sex = random.randint(0, 1)
      name = random.choice(names[sex])
  
      email = "{0}{1}@mail.com".format(name, i)
      user = soc_models.User.objects.create_user(email, email, password='password')
      user.save()
  
      userProfile = soc_models.Profile.objects.create()
      userProfile.user = user
      _year = random.randrange(1962, 1995)
      _month = random.randrange(1, 12)
      _day = random.randrange(1, calendar.monthrange(_year, _month)[1])
      userProfile.dob = datetime.datetime(_year, _month, _day)
  
      userProfile.sex = random.randrange(0, 1)
      userProfile.city = random.randrange(4000000)
      userProfile.country = random.randrange(230)
      userProfile.save()
  </code></pre>
  
  <p>Thank you.</p>