title: Display user group in admin interface?
body: <p>The admin.py at contrib.auth defines the fields to be displayed for the user at the admin interface: </p>
  
  <pre><code>list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff')
  </code></pre>
  
  <p>I want to see the group of each user here:</p>
  
  <p><img src="https://i.stack.imgur.com/vYok4.jpg" alt="enter image description here"></p>
  
  <p>Just for testing purpose when you try to add the "group" field it fail: </p>
  
  <pre><code>list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff', 'group')
  </code></pre>
  
  <p>This error rises:
  : (admin.E109) The value of 'list_display[5]' must not be a ManyToManyField.</p>
  
  <p>After searching I have found only ways to add an app to the admin interface, or to create a custom user model, but I think I'm missing something.</p>
  
  <p>So, how to do it?</p>
  
  <p><strong>SOLVED</strong> --- Thanks to the answer of @{Alexis N-o}</p>
  
  <p>Edit /usr/local/lib/pyton2.7/dist-packages/django/contrib/auth/admin.py</p>
  
  <p>Just before the list_display add this def that seeks for the groups:</p>
  
  <pre><code>def group(self, user):
      groups = []
      for group in user.groups.all():
          groups.append(group.name)
      return ' '.join(groups)
  group.short_description = 'Groups'
  
  list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff', 'group')
  </code></pre>
  
  <p>Then syncdb, and check the change at admin, notice the last column:</p>
  
  <p><img src="https://i.stack.imgur.com/lN94D.jpg" alt="enter image description here"></p>