diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-12-09 19:56:39 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-14 23:13:07 +0000 |
commit | 322b4709d84dadb6d34612781f1fdf0ebad7faa8 (patch) | |
tree | 86c50752c169b50e62cd41907954078eb6aa58e3 | |
parent | 84daa40bc7600df75d93db358be94cac10452936 (diff) | |
download | openembedded-core-contrib-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>
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 6 |
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): return self.get_outcome_text() def __str__(self): - return "%d %s %s" % (self.id, self.project, ",".join([t.target for t in self.target_set.all()])) + return "%s %s %s" % (self.id, self.project, ",".join([t.target for t in self.target_set.all()])) # 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): sstate_text = property(get_sstate_text) def __unicode__(self): - return "%d(%d) %s:%s" % (self.pk, self.build.pk, self.recipe.name, self.task_name) + return "%s(%s) %s:%s" % (self.pk, self.build.pk, self.recipe.name, self.task_name) class Meta: ordering = ('order', 'recipe' ,) @@ -1203,7 +1203,7 @@ class Layer_Version(models.Model): return sorted(result, key=lambda x: x.layer.name) def __unicode__(self): - 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") + 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") class Meta: unique_together = ("layer_source", "up_id") |