title: How to retrieve all permissions assigned to a group in Django
body: <p>I am working on a task to retrieve a set of permissions assigned to a group in Django and I can get the created groups using the below code, but could not use it to get the permissions assigned to them:</p>
  <pre><code>from django.contrib.auth.models import Group, Permission
  groups = Group.objects.all()
  </code></pre>
  <p>I am not really sure how to get permissions assigned to these groups.</p>
  <p><code>permissions = Permission.objects.all()</code> gives me all the permissions, but I could not figure out how to get permissions assigned to a particular group.</p>
  <p>Any pointers would be appreciated.</p>