All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: toaster@yoctoproject.org
Subject: [PATCH 14/18] toaster: fixed format strings
Date: Tue,  8 Dec 2015 17:32:01 +0200	[thread overview]
Message-ID: <8fef020abaa1aaa84ec991e9e1e233b298dff57d.1449588503.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1449588503.git.ed.bartosh@linux.intel.com>
In-Reply-To: <cover.1449588503.git.ed.bartosh@linux.intel.com>

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.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/toaster/orm/models.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 5b8a45d..7b99a1f 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' ,)
@@ -1202,7 +1202,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")
-- 
2.1.4



  parent reply	other threads:[~2015-12-08 16:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 15:31 [PATCH 00/18] Upgrade to Django 1.8 Ed Bartosh
2015-12-08 15:31 ` [PATCH 01/18] toaster: Upgrade to Django 1.8.6 and remove South Ed Bartosh
2015-12-08 15:31 ` [PATCH 02/18] toaster: Remove South migrations Ed Bartosh
2015-12-08 15:31 ` [PATCH 03/18] toaster: Fix references to app paths Ed Bartosh
2015-12-08 15:31 ` [PATCH 04/18] toaster: Create default project with get_or_create* method Ed Bartosh
2015-12-08 15:31 ` [PATCH 05/18] toaster: Start Django machinery for database access Ed Bartosh
2015-12-08 15:31 ` [PATCH 06/18] toaster: rename get_query_set -> get_queryset Ed Bartosh
2015-12-08 15:31 ` [PATCH 07/18] toaster: Update API used to make runbuilds methods run in transactions Ed Bartosh
2015-12-08 15:31 ` [PATCH 08/18] toaster: Prevent deprecation warnings for RedirectView Ed Bartosh
2015-12-08 15:31 ` [PATCH 09/18] toaster: Update deprecated manage.py command Ed Bartosh
2015-12-08 15:31 ` [PATCH 10/18] toaster: Check Django version against toaster-requirements.txt Ed Bartosh
2015-12-08 15:31 ` [PATCH 11/18] toaster: Remove compatible_layerversions() method Ed Bartosh
2015-12-08 15:31 ` [PATCH 12/18] toaster: Amend regex for MySQL database URLs Ed Bartosh
2015-12-08 15:32 ` [PATCH 13/18] toaster: use OneToOneField instead of ForeignKey Ed Bartosh
2015-12-08 15:32 ` Ed Bartosh [this message]
2015-12-08 15:32 ` [PATCH 15/18] toaster: work around 'database is locked' error Ed Bartosh
2015-12-08 15:32 ` [PATCH 16/18] toaster: removed extra calls of migrate Ed Bartosh
2015-12-08 15:32 ` [PATCH 17/18] toaster: monkey patch Queryset Ed Bartosh
2015-12-08 15:32 ` [PATCH 18/18] toaster: rework check for Django version Ed Bartosh
2015-12-09 11:59 ` [PATCH 00/18] Upgrade to Django 1.8 Barros Pena, Belen
2015-12-09 14:47   ` Michael Wood
2015-12-09 17:28     ` Brian Avery
2015-12-09 22:22       ` Ed Bartosh
2015-12-10  3:58         ` Brian Avery
2015-12-10  3:56 [PATCH 01/18] toaster: Upgrade to Django 1.8.6 and remove South brian avery
2015-12-10  3:56 ` [PATCH 00/18] toaster: upgrade to Django 1.8 brian avery
2015-12-10  3:56   ` [PATCH 14/18] toaster: fixed format strings brian avery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8fef020abaa1aaa84ec991e9e1e233b298dff57d.1449588503.git.ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.