[Fixed]-Using the Django auth model for things other than permissions

1👍

If you’re not going to use your groups to handle permissions, you’d better create a separate model, just because you’ll hardly benefit of using the stock model (which is just a permissions container). And customization is much, much easier when you have a separate model. You could start with just:

class EmailGroup(models.Model):
   name = models.CharField(max_length=100)
   users = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name='email_groups')

and extend it to your needs.

But there’s nothing wrong in using contrib.auth models in a different way. Django is a framework, not a CMS, so you’re free to use it as you want.

Leave a comment