summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-11-24 11:20:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-30 15:48:10 +0000
commitb58b982eaf17b1cbe1b5ede1edda960d69cb5586 (patch)
treecc7762cb0b63676dc0e1667646ba1801240e5f3a /bitbake/lib/toaster/orm
parent30a9f65dcc043c1f51fd3128653ea5ecef8e25a0 (diff)
downloadpoky-b58b982eaf17b1cbe1b5ede1edda960d69cb5586.tar.gz
bitbake: toaster: orm models Project class Fix pyflake errors
(Bitbake rev: 69f33397083f54f977fa0cd4dd621731f32fd034) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm')
-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)