I have next models:
class CategoryLesson(models.Model):
title = models.CharField()
class Lesson(models.Model):
title = models.CharField()
category = models.ForeignKey(CategoryLesson)
class UserRole(models.Model):
rolename = models.CharField()
lessons = models.ForeignKey(CategoryLesson)
group = models.ForeignKey(Group)
class SiteUser(models.Model):
username = models.OneToOneField(User)
roles = models.ManyToManyField(UserRole)
There are 3 categories, and no limit users.
And i cant understand how limit access some SiteUser to some CategoryLesson & Lesson . Already watched django-guardian, and dont see some of the differences between this application and django generic has_perm
for this case. Is really i should create 3 models for each category??