blob: 41bfd625c5c75494826a6090cf3cc32ae9579eda [file] [log] [blame]
Siobhan Tully4bc09f22013-04-10 21:15:21 -04001import os
2import datetime
3from django.db import models
4from plstackapi.core.models import PlCoreBase
Siobhan Tully4bc09f22013-04-10 21:15:21 -04005
6class Role(PlCoreBase):
7
Tony Mackfd24d0d2013-04-14 00:59:17 -04008 #ROLE_CHOICES = (('admin', 'Admin'), ('pi', 'Principle Investigator'), ('user','User'))
Tony Mackcdec0902013-04-15 00:38:49 -04009 role_id = models.CharField(max_length=256, unique=True)
Tony Mackfd24d0d2013-04-14 00:59:17 -040010 role_type = models.CharField(max_length=80, unique=True)
Siobhan Tully4bc09f22013-04-10 21:15:21 -040011
12 def __unicode__(self): return u'%s' % (self.role_type)
13
Tony Mackfd24d0d2013-04-14 00:59:17 -040014
15 def save(self, *args, **kwds):
Tony Mack02755d42013-05-02 00:00:10 -040016 self.os_manager.save_role(self)
Tony Mackfd24d0d2013-04-14 00:59:17 -040017 super(Role, self).save(*args, **kwds)
18
19 def delete(self, *args, **kwds):
Tony Mack02755d42013-05-02 00:00:10 -040020 self.os_manager.delete_role(self)
Tony Mackfd24d0d2013-04-14 00:59:17 -040021 super(Role, self).delete(*args, **kwds)
22