27 from django.db
import models
29 from cm.utils.exception
import CMException
30 from common.states
import template_states
42 name = models.CharField(max_length=45)
43 description = models.CharField(max_length=512)
44 memory = models.IntegerField()
45 cpu = models.IntegerField()
50 state = models.IntegerField(choices=template_states)
51 points = models.IntegerField()
52 ec2name = models.IntegerField(default=0)
76 d[
'template_id'] = self.id
98 template = Template.objects.get(pk=template_id)
100 raise CMException(
'template_get')
102 if not template
or template.state != template_states[
'active']:
103 raise CMException(
'template_get')