title: Auto-create model with foreign key when model is created - Django
body: <p>I am making a comments section on my webpage and want users to be able to upvote or downvote a comment. </p>
  
  <p>My models are as such:</p>
  
  <pre><code>class Comment(models.Model):
      owner = models.ForeignKey(User)
      body = models.TextField(null=True, blank=True, max_length=500)
      created_at = models.DateTimeField(auto_now_add=True)
      updated_at = models.DateTimeField(auto_now=True)
  
  
  class Vote(models.Model):
      comment = models.ForeignKey(Comment)
      upvote = models.SmallIntegerField(null=True, blank=True, default=0)
      downvote = models.SmallIntegerField(null=True, blank=True, default=0)
      created_at = models.DateTimeField(auto_now_add=True)
      updated_at = models.DateTimeField(auto_now=True)
  </code></pre>
  
  <p>When a user posts a comment, I want it to also create a Vote model that is linked to that comment. </p>
  
  <p>I am new to django and programming but from my understanding, I need to create a save hook or something similar? </p>