##// END OF EJS Templates
A "Campaign" has many "Locations", A "Location" has many Experiments....
Fiorella Quino -
r48:292bafbb7b12
parent child
Show More
@@ -42,17 +42,6 DEV_PORTS = {
42 42
43 43 # Create your models here.
44 44
45 class Location(models.Model):
46
47 name = models.CharField(max_length = 30)
48 description = models.TextField(blank=True, null=True)
49
50 class Meta:
51 db_table = 'db_location'
52
53 def __unicode__(self):
54 return u'%s' % self.name
55
56 45 class DeviceType(models.Model):
57 46
58 47 name = models.CharField(max_length = 10, choices = DEV_TYPES, default = 'rc')
@@ -102,11 +91,23 class Campaign(models.Model):
102 91 def __unicode__(self):
103 92 return u'%s' % (self.name)
104 93
94 class Location(models.Model):
95
96 name = models.CharField(max_length = 30)
97 description = models.TextField(blank=True, null=True)
98 campaign = models.ForeignKey(Campaign)
99
100 class Meta:
101 db_table = 'db_location'
102
103 def __unicode__(self):
104 return u'%s' % self.name
105
105 106 class Experiment(models.Model):
106 107
107 108 template = models.BooleanField(default=False)
108 109
109 campaign = models.ForeignKey(Campaign)
110 location = models.ForeignKey(Location)
110 111 name = models.CharField(max_length=40, default='')
111 112 start_time = models.TimeField(default='00:00:00')
112 113 end_time = models.TimeField(default='23:59:59')
General Comments 0
You need to be logged in to leave comments. Login now