2 from django.db import models
3 from core.models import PlCoreBase
4 from core.models import User,Site,Slice
5 from encrypted_fields import EncryptedCharField
7 class UserCredential(PlCoreBase):
8 user = models.ForeignKey(User, related_name='credentials', help_text="The User this credential is associated with")
10 name = models.SlugField(help_text="The credential type, e.g. ec2", max_length=128)
11 key_id = models.CharField(help_text="The backend id of this credential", max_length=1024)
12 enc_value = EncryptedCharField(help_text="The key value of this credential", max_length=1024)
15 def __unicode__(self):
18 class SiteCredential(PlCoreBase):
19 site = models.ForeignKey(Site, related_name='credentials', help_text="The User this credential is associated with")
21 name = models.SlugField(help_text="The credential type, e.g. ec2", max_length=128)
22 key_id = models.CharField(help_text="The backend id of this credential", max_length=1024)
23 enc_value = EncryptedCharField(help_text="The key value of this credential", max_length=1024)
26 def __unicode__(self):
29 class SliceCredential(PlCoreBase):
30 slice = models.ForeignKey(Slice, related_name='credentials', help_text="The User this credential is associated with")
32 name = models.SlugField(help_text="The credential type, e.g. ec2", max_length=128)
33 key_id = models.CharField(help_text="The backend id of this credential", max_length=1024)
34 enc_value = EncryptedCharField(help_text="The key value of this credential", max_length=1024)
37 def __unicode__(self):