dynamicweb/datacenterlight/models.py

35 lines
934 B
Python
Raw Normal View History

2016-12-20 23:05:20 +00:00
from django.db import models
2017-07-26 17:38:38 +00:00
class VMTemplate(models.Model):
name = models.CharField(max_length=50)
opennebula_vm_template_id = models.IntegerField()
2017-07-26 17:38:38 +00:00
@classmethod
def create(cls, name, opennebula_vm_template_id):
vm_template = cls(
name=name, opennebula_vm_template_id=opennebula_vm_template_id)
2017-07-26 17:38:38 +00:00
return vm_template
2017-08-16 22:52:23 +00:00
class StripePlan(models.Model):
"""
A model to store Data Center Light's created Stripe plans
"""
stripe_plan_id = models.CharField(max_length=256, null=True)
2017-08-16 22:52:23 +00:00
@classmethod
def create(cls, stripe_plan_id):
stripe_plan = cls(stripe_plan_id=stripe_plan_id)
return stripe_plan
class ContactUs(models.Model):
name = models.CharField(max_length=250)
email = models.CharField(max_length=250)
message = models.TextField()
field = models.DateTimeField(auto_now_add=True)
2018-02-27 22:39:19 +00:00
def __str__(self):
return self.name