blob: 8bf9c06eb49e289ce56f7fbd87140686e8487659 [file] [log] [blame]
Siobhan Tully4bc09f22013-04-10 21:15:21 -04001import os
2from django.db import models
Siobhan Tully30fd4292013-05-10 08:59:56 -04003from core.models import PlCoreBase
Siobhan Tullybfd11dc2013-09-03 12:59:24 -04004from django.contrib.contenttypes import generic
Siobhan Tully4bc09f22013-04-10 21:15:21 -04005
6# Create your models here.
7
Siobhan Tullybf1153a2013-05-27 20:53:48 -04008class Deployment(PlCoreBase):
9 name = models.CharField(max_length=200, unique=True, help_text="Name of the Deployment")
Siobhan Tully4bc09f22013-04-10 21:15:21 -040010
11 def __unicode__(self): return u'%s' % (self.name)
12
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040013
14class DeploymentRole(PlCoreBase):
15
16 ROLE_CHOICES = (('admin','Admin'),)
17 role = models.CharField(choices=ROLE_CHOICES, unique=True, max_length=30)
18
19 def __unicode__(self): return u'%s' % (self.role)
20
21class DeploymentPrivilege(PlCoreBase):
22
23 user = models.ForeignKey('User', related_name='deployment_privileges')
24 deployment = models.ForeignKey('Deployment', related_name='deployment_privileges')
25 role = models.ForeignKey('DeploymentRole')
26
27 def __unicode__(self): return u'%s %s %s' % (self.deployment, self.user, self.role)
28