blob: bd97f52237dd8b96c86fc2c7918ffee90a744f53 [file] [log] [blame]
Siobhan Tully4bc09f22013-04-10 21:15:21 -04001import os
2import datetime
3from django.db import models
Siobhan Tully30fd4292013-05-10 08:59:56 -04004from core.models import PlCoreBase
Siobhan Tullybfd11dc2013-09-03 12:59:24 -04005from django.contrib.contenttypes.models import ContentType
6from django.contrib.contenttypes import generic
Siobhan Tully4bc09f22013-04-10 21:15:21 -04007
8class Role(PlCoreBase):
9
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040010 role_type = models.CharField(max_length=80, verbose_name="Name")
Tony Mack7665f812013-10-07 22:55:16 -040011 role = models.CharField(max_length=80, verbose_name="Keystone role id", null=True, blank=True)
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040012 description = models.CharField(max_length=120, verbose_name="Description")
13 content_type = models.ForeignKey(ContentType, verbose_name="Role Scope")
Siobhan Tully4bc09f22013-04-10 21:15:21 -040014
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040015 def __unicode__(self): return u'%s:%s' % (self.content_type,self.role_type)
Siobhan Tully4bc09f22013-04-10 21:15:21 -040016
Tony Mackfd24d0d2013-04-14 00:59:17 -040017
18 def save(self, *args, **kwds):
Tony Mackfd24d0d2013-04-14 00:59:17 -040019 super(Role, self).save(*args, **kwds)
20
21 def delete(self, *args, **kwds):
Tony Mackfd24d0d2013-04-14 00:59:17 -040022 super(Role, self).delete(*args, **kwds)
23