title: Pulling a username - 'ManyRelatedManager' object does not support indexing
body: <p>I'm creating on a website that allows users to play an asynchronous game. I'm running Django 1.5 with Python 2.7.5, and using Django's native user authentication API. Rather than create a custom User model, I've linked each user to a custom UserDetails class. The relevant code for the UserDetails class is here:</p>
  
  <pre><code>    class UserDetails(models.Model):
          user = models.OneToOneField(User)
          join_date = models.DateTimeField(auto_now_add=True)
          games = models.ManyToManyField(Game, default=None)
  </code></pre>
  
  <p>Each game links to the UserDetails with a ManyToMany field. Relevant code from the game.models here:</p>
  
  <pre><code>    class Game(models.Model):
          title = models.CharField(max_length=60)
          create_date = models.DateTimeField(auto_now_add=True)
          started = models.BooleanField(default=False)
          players = models.ManyToManyField('user.UserDetails', default=None)
  </code></pre>
  
  <p>On the front page, I want to have a table listing all the games in progress. In the views.py, I'm using this command:</p>
  
  <pre><code>    games_in_signup = Game.objects.filter(started=False)
  </code></pre>
  
  <p>...and passing it to the template. Finally, in the template I have this code to generate the rows of the table:</p>
  
  <pre><code>    {% for g in games_in_signup %}
      &lt;tr&gt;
          &lt;td&gt;{{ g.title }}&lt;/td&gt;
          &lt;td&gt;{{ g.players|first }}&lt;/td&gt;
          &lt;td&gt;{{ g.number_of_players }}&lt;/td&gt;
          &lt;td&gt;{{ g.players.all|length }}&lt;/td&gt;
          &lt;td&gt;{{ g.create_date }}&lt;/td&gt;
      &lt;/tr&gt;
      {% endfor %}
  </code></pre>
  
  <p>Instead of giving me the username of the first player, as I would wish for, I get <i>"TypeError at /game/ 'ManyRelatedManager' object does not support indexing"</i>. if I try changing</p>
  
  <pre><code>        &lt;td&gt;{{ g.players|first }}&lt;/td&gt;    
  </code></pre>
  
  <p>...to...</p>
  
  <pre><code>        &lt;td&gt;{{ g.players.all|first }}&lt;/td&gt;
  </code></pre>
  
  <p>...I get <i>"AttributeError at /game/ 'UserDetails' object has no attribute 'username'"</i>.</p>
  
  <p>The games run fine with how I have it set up, but this has been giving me fits. There may be a better way to set it up than this, and I'd welcome any advice in that respect. In any case, do you know how I can get the template to pull the username first player out of the list of players for each game? Thanks!</p>