summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/toaster/orm/models.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index fd15fbe7be..394c886973 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -38,6 +38,7 @@ import re
38import itertools 38import itertools
39from signal import SIGUSR1 39from signal import SIGUSR1
40 40
41
41import logging 42import logging
42logger = logging.getLogger("toaster") 43logger = logging.getLogger("toaster")
43 44
@@ -178,24 +179,27 @@ class ProjectManager(models.Manager):
178 else: 179 else:
179 return projects[0] 180 return projects[0]
180 181
182
181class Project(models.Model): 183class Project(models.Model):
182 search_allowed_fields = ['name', 'short_description', 'release__name', 'release__branch_name'] 184 search_allowed_fields = ['name', 'short_description', 'release__name',
185 'release__branch_name']
183 name = models.CharField(max_length=100) 186 name = models.CharField(max_length=100)
184 short_description = models.CharField(max_length=50, blank=True) 187 short_description = models.CharField(max_length=50, blank=True)
185 bitbake_version = models.ForeignKey('BitbakeVersion', null=True) 188 bitbake_version = models.ForeignKey('BitbakeVersion', null=True)
186 release = models.ForeignKey("Release", null=True) 189 release = models.ForeignKey("Release", null=True)
187 created = models.DateTimeField(auto_now_add = True) 190 created = models.DateTimeField(auto_now_add=True)
188 updated = models.DateTimeField(auto_now = True) 191 updated = models.DateTimeField(auto_now=True)
189 # This is a horrible hack; since Toaster has no "User" model available when 192 # This is a horrible hack; since Toaster has no "User" model available when
190 # running in interactive mode, we can't reference the field here directly 193 # running in interactive mode, we can't reference the field here directly
191 # Instead, we keep a possible null reference to the User id, as not to force 194 # Instead, we keep a possible null reference to the User id,
195 # as not to force
192 # hard links to possibly missing models 196 # hard links to possibly missing models
193 user_id = models.IntegerField(null = True) 197 user_id = models.IntegerField(null=True)
194 objects = ProjectManager() 198 objects = ProjectManager()
195 199
196 # set to True for the project which is the default container 200 # set to True for the project which is the default container
197 # for builds initiated by the command line etc. 201 # for builds initiated by the command line etc.
198 is_default = models.BooleanField(default = False) 202 is_default= models.BooleanField(default=False)
199 203
200 def __unicode__(self): 204 def __unicode__(self):
201 return "%s (Release %s, BBV %s)" % (self.name, self.release, self.bitbake_version) 205 return "%s (Release %s, BBV %s)" % (self.name, self.release, self.bitbake_version)