bitbake: toasterui: UI query performance improvements

We reduce the number of queries by using "select_related"
to bring in more data in a single query. Improvements in
project page refresh, recipes table and tasks table.

(Bitbake rev: eefdae12120f879b555ba0a353277a18675eecbc)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2015-02-17 17:24:29 +00:00
committed by Richard Purdie
parent 9c358bd1d7
commit e133fbf301
2 changed files with 16 additions and 10 deletions

View File

@@ -362,11 +362,14 @@ class Task(models.Model):
return "Not Executed"
def get_description(self):
helptext = HelpText.objects.filter(key=self.task_name, area=HelpText.VARIABLE, build=self.build)
if '_helptext' in vars(self) and self._helptext != None:
return self._helptext
try:
return helptext[0].text
except IndexError:
return ''
self._helptext = HelpText.objects.get(key=self.task_name, area=HelpText.VARIABLE, build=self.build).text
except HelpText.DoesNotExit:
self._helptext = None
return self._helptext
build = models.ForeignKey(Build, related_name='task_build')
order = models.IntegerField(null=True)