title: How to use a single model 'employee' for storing employees and managers in django?
body: <p>I am creating a ERP type system, where I have a django model(table) called 'employee'.</p>
  
  <p>I want every worker of a company to be an 'employee'. (ex. coder, boss, janitor, line manager etc. will all be 'employee')</p>
  
  <p>I also want some employees to have one or more line manager/s. And a line manager can have multiple employee under him/her.</p>
  
  <p>So the question is how to make line manager a part of 'employee' table, and have a field which describes 'employees' under line manager? So that I can display what line manager/s an employee has. Also display what line manager has which employees under him?</p>
  
  <p>Here's the models file:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class Team(models.Model):
      name = models.CharField(max_length=64)
      t_id = models.CharField(max_length=64)
      def __str__(self):
          return self.name
  
  
  class Employee(models.Model):
      
      
      first_name=models.CharField(max_length=64)
      
      last_name=models.CharField(max_length=64)
      
      e_id=models.CharField(max_length=64)
  
      current_role=models.CharField(max_length=64) # "coder"
      
      past_roles=models.CharField(max_length=512) # "coder, developer, janator" (seperator: ,)
  
      teams = models.ManyToManyField(Team, related_name="employees", blank=True)
  
      joining_date = models.DateTimeField(null=True,blank=True)
  
      desk_location=models.CharField(max_length=64)
  
      #How do I go about this?
      line_manager = ???
  
  
      def __str__(self):
          return self.first_name</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am new to django, so please forgive me if I am missing something very simple. Also if there is a more elegant solution which requires me to add additional tables, I dont mind.</p>
  
  <p>Thanks</p>