2
Copyright 2009 H. Lee Moffitt Cancer Center and Research Institute, Inc.
5
@author: Michael Hall <mhall119@gmail.com>
7
from django.contrib import auth
8
from django.db import models
9
from django.contrib.contenttypes.models import ContentType
11
class Role(models.Model):
15
unique_together = (('model', 'role'),)
17
model = models.ForeignKey(ContentType, verbose_name='Model Type')
18
role = models.CharField(max_length=255, verbose_name='Role Name')
19
permissions = models.ManyToManyField(auth.models.Permission, blank=True, verbose_name='Role Permissions')
21
def __unicode__(self):
22
return "%s.%s: %s" % (self.model.app_label, self.model, self.role)