title: How can I resolve or fix Django cyclic model field dependencies?
body: <p>I've a database design corresponding to the following pseudo-code:</p>
  
  <pre><code>class AModel(models.Model):
      c_model_instances = models.OneToOne(CModel, ...)  # "is a" relationship
  
  class BModel(models.Model):
      a_model_instances = models.ManyToMany(AModel, ...)  # "contains" relationship
  
  class CModel(models.Model):
      b_model_instances = models.ManyToMany(BModel, ...)  # "contains" relationship
  </code></pre>
  
  <p>Belief it or not... this design makes total sense from a business perspective :) However of course I get an error <code>NameError: name 'CModel' is not defined</code> when I try to migrate the database. How can I resolve or fix (via different design) the issue?</p>