title: How Do I Represent Student-Lecturer Relationship in Django?
body: <p>So I'm trying to make a web app that is meant to aid interaction between students and teachers. </p>
  
  <p>However, I need to know how to structure the model of relationships in Django. Here are 2 things you should know:</p>
  
  <ol>
  <li>A teacher can have many students (users) under him or her.</li>
  <li>A student can only have one user as his teacher.</li>
  </ol>
  
  <p>In other words, teachers are meant to have as many students as possible, while each student can only have one teacher.</p>
  
  <p>How should I represent this in Django? And what's the best way to manage this relationship? For the latter question, I'm thinking about creating a class that looks like this:</p>
  
  <pre><code>class Relationship(models.Model):
       ##student and lecturer models shall inherit the User class; hence, the
  
  
       student = models.ForeignKey(User, related_name = 'lecturer_set')
       lecturer = models.ForeignKey(User, related_name = 'student_set')
  
       class Meta:
           unique_together = ('student', 'lecturer')
  </code></pre>
  
  <p>PS: I know the above class might be wrong. Just trying to explain what I need to implement in the Relationship class.</p>