title: Django Foreignkey in MongoDB's EmbeddedField
body: <p>I am using Djongo engine for MongoDB in my Django project.</p>
  <p>I have two tables</p>
  <pre><code># app/models.py
  # My Main Table
  
  class Questions(models.Model):
      questionId = models.UUIDField(default=uuid.uuid4, editable=True, unique=True)
      question = models.TextField()
      answer = models.EmbeddedField(
          model_container=Answers
      )
      date = models.DateTimeField(auto_now_add=True, blank=True)
      User = models.ForeignKey(UserDetailTable,on_delete=models.CASCADE,related_name='userinfo')
  </code></pre>
  <p>and</p>
  <pre><code># app/models.py
  # This table needs to be Embedded in Questions Table
  
  class Answers(models.Model):
      answerId = models.UUIDField(default=uuid.uuid4, editable=True, unique=True)
      answer = models.TextField()
      date = models.DateTimeField(auto_now_add=True)
      User = models.ForeignKey(UserDetailTable,on_delete=models.CASCADE)
  
      class Meta:
          abstract = True
  </code></pre>
  <p>I want to embed <code>Answers</code> in the <code>Questions</code> table.
  But I am getting this error</p>
  <pre><code>django.core.exceptions.ValidationError: ['Field &quot;App.Answers.User&quot; of model container:&quot;&lt;class \'App.models.Answers\'&gt;&quot; cannot be of type &quot;&lt;class \'django.db.models.fields.related.ForeignKey\'&gt;&quot;']
  </code></pre>
  <p>I know this error is because I am using <code>User = models.ForeignKey(UserDetailTable,on_delete=models.CASCADE)</code> in <code>Answers</code> which is itself an EmbeddedField on <code>Questions</code>.</p>
  <p>How Can I solve this error?</p>
  <p>As there will be multiple answers from different users on the same question and with ForeignKey it will be simple to show the user's info along with his/her answer.</p>
  <p>I have also looked djongo's docs but couldn't find anything.</p>
  <p>Any help would be appreciated.</p>