mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 12:49:34 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
30a9f65dcc
commit
b58b982eaf
@@ -38,6 +38,7 @@ import re
|
|||||||
import itertools
|
import itertools
|
||||||
from signal import SIGUSR1
|
from signal import SIGUSR1
|
||||||
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger("toaster")
|
logger = logging.getLogger("toaster")
|
||||||
|
|
||||||
@@ -178,24 +179,27 @@ class ProjectManager(models.Manager):
|
|||||||
else:
|
else:
|
||||||
return projects[0]
|
return projects[0]
|
||||||
|
|
||||||
|
|
||||||
class Project(models.Model):
|
class Project(models.Model):
|
||||||
search_allowed_fields = ['name', 'short_description', 'release__name', 'release__branch_name']
|
search_allowed_fields = ['name', 'short_description', 'release__name',
|
||||||
|
'release__branch_name']
|
||||||
name = models.CharField(max_length=100)
|
name = models.CharField(max_length=100)
|
||||||
short_description = models.CharField(max_length=50, blank=True)
|
short_description = models.CharField(max_length=50, blank=True)
|
||||||
bitbake_version = models.ForeignKey('BitbakeVersion', null=True)
|
bitbake_version = models.ForeignKey('BitbakeVersion', null=True)
|
||||||
release = models.ForeignKey("Release", null=True)
|
release = models.ForeignKey("Release", null=True)
|
||||||
created = models.DateTimeField(auto_now_add = True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
updated = models.DateTimeField(auto_now = True)
|
updated = models.DateTimeField(auto_now=True)
|
||||||
# This is a horrible hack; since Toaster has no "User" model available when
|
# This is a horrible hack; since Toaster has no "User" model available when
|
||||||
# running in interactive mode, we can't reference the field here directly
|
# running in interactive mode, we can't reference the field here directly
|
||||||
# Instead, we keep a possible null reference to the User id, as not to force
|
# Instead, we keep a possible null reference to the User id,
|
||||||
|
# as not to force
|
||||||
# hard links to possibly missing models
|
# hard links to possibly missing models
|
||||||
user_id = models.IntegerField(null = True)
|
user_id = models.IntegerField(null=True)
|
||||||
objects = ProjectManager()
|
objects = ProjectManager()
|
||||||
|
|
||||||
# set to True for the project which is the default container
|
# set to True for the project which is the default container
|
||||||
# for builds initiated by the command line etc.
|
# for builds initiated by the command line etc.
|
||||||
is_default = models.BooleanField(default = False)
|
is_default= models.BooleanField(default=False)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return "%s (Release %s, BBV %s)" % (self.name, self.release, self.bitbake_version)
|
return "%s (Release %s, BBV %s)" % (self.name, self.release, self.bitbake_version)
|
||||||
|
|||||||
Reference in New Issue
Block a user