blob: 7b3268c9984bcddbb19ea34a9e86fe81ec06b6a9 [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
5
6# Create your models here.
7
8class Role(PlCoreBase):
9
10 ROLE_CHOICES = (('admin', 'Admin'), ('pi', 'Principle Investigator'), ('user','User'))
11 role_id = models.CharField(max_length=256, unique=True)
12 role_type = models.CharField(max_length=80, unique=True, choices=ROLE_CHOICES)
13
14 def __unicode__(self): return u'%s' % (self.role_type)
15
16 def save(self):
17 if not self.id:
18 self.created = datetime.date.today()
19 self.updated = datetime.datetime.today()
20 super(Role, self).save()