title: django - using of related_name in ManyToMany and in ForeignKey
body: <p>I have two models (and also using the auth.user). the <strong>auth.user</strong> and the <strong>Ride</strong> model have two relations between them, and the <strong>Ride</strong> model and <strong>Destination</strong> model have two relations between them.</p>
  
  <p>The Ride has <strong>many</strong> middle destinations and <strong>one</strong> final destination.
  The Ride has <strong>many</strong> passengers and <strong>one</strong> driver.</p>
  
  <pre><code>class Destination(models.Model):
      name=models.CharField(max_length=30)
  
  class Ride(models.Model):
      driver = models.ForeignKey('auth.User', related_name='rides_as_driver')
      destination=models.ForeignKey(Destination)
      leaving_time=models.DateTimeField()
      num_of_spots=models.IntegerField()
      passengers=models.ManyToManyField('auth.User', related_name="rides_as_passenger")
      mid_destinations=models.ManyToManyField(Destination)
  </code></pre>
  
  <p>I am trying to fully understand what is the meaning of the related_name attribute. I read a lot about it but still not sure...</p>
  
  <p>Also I read that if I have two relations between to models, I have to use the related_name.</p>
  
  <p><strong>Can someone explain to me:</strong></p>
  
  <ul>
  <li>What exactly is the related_name attribute? When do I use it?</li>
  <li>When and Where will I be using the rides_as_driver and rides_as_passenger? </li>
  <li>What should I put in the fields with the Destination? (middle destinations and final destination)?</li>
  </ul>
  
  <p>Thanks a lot!</p>