summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-12-09 19:56:39 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-14 23:13:07 +0000
commit322b4709d84dadb6d34612781f1fdf0ebad7faa8 (patch)
tree86c50752c169b50e62cd41907954078eb6aa58e3 /bitbake
parent84daa40bc7600df75d93db358be94cac10452936 (diff)
downloadpoky-322b4709d84dadb6d34612781f1fdf0ebad7faa8.tar.gz
bitbake: toaster: fixed format strings
Printing id as a number breaks toaster if object is not saved yet as id/pk is None in this case. Changed format spec to print id as a string in __str__ and __unicode__ methods of Build, Task and LayerVersion models. (Bitbake rev: d5ca2bae623db214764324da5c9e4dac6beef760) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/orm/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index f07fedaf02..3c51c6f798 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -370,7 +370,7 @@ class Build(models.Model):
370 return self.get_outcome_text() 370 return self.get_outcome_text()
371 371
372 def __str__(self): 372 def __str__(self):
373 return "%d %s %s" % (self.id, self.project, ",".join([t.target for t in self.target_set.all()])) 373 return "%s %s %s" % (self.id, self.project, ",".join([t.target for t in self.target_set.all()]))
374 374
375 375
376# an Artifact is anything that results from a Build, and may be of interest to the user, and is not stored elsewhere 376# an Artifact is anything that results from a Build, and may be of interest to the user, and is not stored elsewhere
@@ -552,7 +552,7 @@ class Task(models.Model):
552 sstate_text = property(get_sstate_text) 552 sstate_text = property(get_sstate_text)
553 553
554 def __unicode__(self): 554 def __unicode__(self):
555 return "%d(%d) %s:%s" % (self.pk, self.build.pk, self.recipe.name, self.task_name) 555 return "%s(%s) %s:%s" % (self.pk, self.build.pk, self.recipe.name, self.task_name)
556 556
557 class Meta: 557 class Meta:
558 ordering = ('order', 'recipe' ,) 558 ordering = ('order', 'recipe' ,)
@@ -1203,7 +1203,7 @@ class Layer_Version(models.Model):
1203 return sorted(result, key=lambda x: x.layer.name) 1203 return sorted(result, key=lambda x: x.layer.name)
1204 1204
1205 def __unicode__(self): 1205 def __unicode__(self):
1206 return "%d %s (VCS %s, Project %s)" % (self.pk, str(self.layer), self.get_vcs_reference(), self.build.project if self.build is not None else "No project") 1206 return "%s %s (VCS %s, Project %s)" % (self.pk, str(self.layer), self.get_vcs_reference(), self.build.project if self.build is not None else "No project")
1207 1207
1208 class Meta: 1208 class Meta:
1209 unique_together = ("layer_source", "up_id") 1209 unique_together = ("layer_source", "up_id")