blob: 2102a6efa448cff97727a0ff709bde2a3fc3ad1e [file] [log] [blame]
Siobhan Tullybfd11dc2013-09-03 12:59:24 -04001import os
2from django.db import models
3from core.models import PlCoreBase
4
5# Create your models here.
6
7class PlanetStack(PlCoreBase):
8 description = models.CharField(max_length=200, unique=True, default="PlanetStack", help_text="Used for scoping of roles at the PlanetStack Application level")
9
10 class Meta:
11 verbose_name_plural = "PlanetStack"
12 app_label = "core"
13
14 def __unicode__(self): return u'%s' % (self.description)
15
16class PlanetStackRole(PlCoreBase):
17 ROLE_CHOICES = (('admin','Admin'),)
18 role = models.CharField(choices=ROLE_CHOICES, unique=True, max_length=30)
19
20 def __unicode__(self): return u'%s' % (self.role)
21
22class PlanetStackPrivilege(PlCoreBase):
Sapan Bhatia13d2db92014-11-11 21:47:45 -050023 user = models.ForeignKey('User', related_name='planetstackprivileges')
24 planetstack = models.ForeignKey('PlanetStack', related_name='planetstackprivileges', default=1)
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040025 role = models.ForeignKey('PlanetStackRole')
26
27 def __unicode__(self): return u'%s %s %s' % (self.planetstack, self.user, self.role)
28
29
30