[Answer]-How would I check permissions in a template for a generic model?

1👍

I would suggest using django-guardian for this.

In the meta class of the model you can assign permissions as a tuple.

permissions = ((“edit”, “Can edit model”), etc)

Then you can manage editing and deleting of each object.

Then to implement checking if a user has the permission to do an action for that object you can using the template tags found here http://django-guardian.readthedocs.org/en/latest/api/guardian.templatetags.guardian_tags.html.

JD

Leave a comment