title: Call not yet defined Model's manager in predefined Model Method Django
body: <p>I have 2 models:</p>
  <pre><code>class Person(models.Model):
      name = models.CharField(max_length=150)
  
      def __str__(self):
          return self.name
  
  
  class Message(models.Model):
      sender = models.ForeignKey(Person, related_name='messages_sent', on_delete=models.CASCADE)
      recipient = models.ForeignKey(Person, related_name='messages_recieved', on_delete=models.CASCADE)
      text = models.TextField()
  
      def __str__(self):
          return self.text
  </code></pre>
  <p>Notice <code>Person</code> was defined before <code>Message</code>.</p>
  <p>I can reference <code>Message</code> before it's definition in <code>Person</code> if I use a <code>ForeignKey</code> like so:</p>
  <pre><code>class Person(models.Model):
      myfield = models.ForeignKey('message', on_delete=models.CASCADE)
  </code></pre>
  <p>to call a not yet defined Model before definition.</p>
  <p>But what's the best way to call a not yet defined Model in a previously defined Model's method?</p>
  <p><strong>Example:</strong></p>
  <pre><code>class Person(models.Model):
      name = models.CharField(max_length=150)
      myfield = models.ForeignKey('message', on_delete=models.CASCADE)  # First reference before definition
  
      def __str__(self):
          return self.name
  
      def send_message(self, message, recipient):
          sent_message = Message.objects.create(sender=self, recipient=recipient, text=message)  # Second reference before definition in a method somehow?
          return sent_message
  
  
  class Message(models.Model):
      sender = models.ForeignKey(Person, related_name='messages_sent', on_delete=models.CASCADE)
      recipient = models.ForeignKey(Person, related_name='messages_recieved', on_delete=models.CASCADE)
      text = models.TextField()
  
      def __str__(self):
          return self.text
  </code></pre>
  <p>Is there a way to do this without defining the Person model below the Message model?</p>
  <p>If so, what'd be the best approach?</p>
  <p>Thanks in advance!</p>
  <p><strong>EDIT:</strong></p>
  <p>This actually would work even with defining the model later down the line.</p>
  <p>I'm not actually sure why I received an error before.</p>