| 
									
										
										
										
											2016-12-20 18:05:20 -05:00
										 |  |  | from django.db import models | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-14 23:34:06 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-26 19:38:38 +02:00
										 |  |  | class VMTemplate(models.Model): | 
					
						
							|  |  |  |     name = models.CharField(max_length=50) | 
					
						
							| 
									
										
										
										
											2017-07-26 20:35:12 +02:00
										 |  |  |     opennebula_vm_template_id = models.IntegerField() | 
					
						
							| 
									
										
										
										
											2017-07-26 19:38:38 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     @classmethod | 
					
						
							| 
									
										
										
										
											2017-07-26 20:35:12 +02:00
										 |  |  |     def create(cls, name, opennebula_vm_template_id): | 
					
						
							| 
									
										
										
										
											2017-08-27 13:19:05 +05:30
										 |  |  |         vm_template = cls( | 
					
						
							|  |  |  |             name=name, opennebula_vm_template_id=opennebula_vm_template_id) | 
					
						
							| 
									
										
										
										
											2017-07-26 19:38:38 +02:00
										 |  |  |         return vm_template | 
					
						
							| 
									
										
										
										
											2017-08-17 04:22:23 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class StripePlan(models.Model): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     A model to store Data Center Light's created Stripe plans | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2017-08-22 01:55:45 +05:30
										 |  |  |     stripe_plan_id = models.CharField(max_length=256, null=True) | 
					
						
							| 
									
										
										
										
											2017-08-17 04:22:23 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |     @classmethod | 
					
						
							|  |  |  |     def create(cls, stripe_plan_id): | 
					
						
							|  |  |  |         stripe_plan = cls(stripe_plan_id=stripe_plan_id) | 
					
						
							|  |  |  |         return stripe_plan | 
					
						
							| 
									
										
										
										
											2017-08-27 13:19:05 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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-28 04:09:19 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |     def __str__(self): | 
					
						
							|  |  |  |         return self.name |