title: How to retrieve all permissions of a specific model in django?
body: <p>By default each django model has 3 permissions (add, change, delete). In a model I can define my custom permission to adds more. </p>
  
  <pre><code>class Company(models.Model):
      owner = models.ForeignKey(User)
      name = models.CharField(max_length=64, unique=True)
      description = models.TextField(max_length=512)
      created_on = models.DateTimeField(auto_now_add=timezone.now)
  
      class Meta:
          permissions = (
              ("erp_view_company", "Can see the company information"),
              ("erp_edit_company", "Can edit the company information"),
              ("erp_delete_company", "Can delete the company"),
          )
  </code></pre>
  
  <p>When you migrate, these permissions are automatically created at DB level. How can you retrieve all the permissions from a model?</p>
  
  <pre><code># retrieves the permissions
  permissions = Permission.objects.filter(get_all_permissions_of_model_Company)
  # adds permissions to group
  group = Group.objects.create(name='foo', permissions=permissions)
  # adds user to group
  user.groups.add(group)
  </code></pre>