title: Django: How to create a dynamic related_name for an inherited parent model?
body: <p>I have 4 models:</p>
  
  <pre><code>class User(models.Model):
      name = models.CharField(max_length=255)
  
  class A(models.Model):
      user= models.ForeignKey("User", related_name="u_a", on_delete=models.CASCADE)
      title = models.CharField(max_length=255)
  
  class B(A):
      user= models.ForeignKey("User", related_name="u_b", on_delete=models.CASCADE) 
      #isn't the code repeated???
      b_field = CharField(max_length=255)
  
  class C(A):
      user= models.ForeignKey("User", related_name="u_c", on_delete=models.CASCADE) 
      #isn't the code repeated???
      c_field = CharField(max_length=255)
  </code></pre>
  
  <p>Here, A has a <code>ForeignKey</code> relationsip with <strong>User</strong> and a reverse relationship as <code>u_a</code>. But <strong>B</strong> and <strong>C</strong> are children of <strong>A</strong>.</p>
  
  <p>So It appears to me as if Do not repeat your code is violated. How to overcome this?</p>