bitbake: toaster: fix help texts not showing for most tasks

These were not being collected properly because we were explicitly
excluding variables defined as functions from being stored in the
database. We don't want these to be shown in the variables list, and in
any case it makes sense for these to be stored elsewhere, so create a
separate model to store these.

Fixes [YOCTO #6050].

(Bitbake rev: 0d76a5461ce4bd554ff70a465064969e53edf0a4)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton
2014-04-03 11:16:23 +01:00
committed by Richard Purdie
parent fee85f01bb
commit 432505d563
3 changed files with 239 additions and 11 deletions

View File

@@ -175,9 +175,9 @@ class Task(models.Model):
return "Not Executed"
def get_description(self):
variable = Variable.objects.filter(variable_name=self.task_name, build = self.build)
helptext = HelpText.objects.filter(key=self.task_name, area=HelpText.VARIABLE, build=self.build)
try:
return variable[0].description
return helptext[0].text
except IndexError:
return ''
@@ -343,6 +343,15 @@ class VariableHistory(models.Model):
line_number = models.IntegerField(null=True)
operation = models.CharField(max_length=16)
class HelpText(models.Model):
VARIABLE = 0
HELPTEXT_AREA = ((VARIABLE, 'variable'), )
build = models.ForeignKey(Build, related_name='helptext_build')
area = models.IntegerField(choices=HELPTEXT_AREA)
key = models.CharField(max_length=100)
text = models.TextField()
class LogMessage(models.Model):
INFO = 0
WARNING = 1