summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/models.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-07-21 14:43:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-26 08:10:36 +0100
commit04d1ad5fe7f5029a5b46a10ef18f7f335c17474b (patch)
tree77355ee66ff7975325bf969bb66b94cc90856602 /bitbake/lib/toaster/orm/models.py
parent97278fb51c3d4fe46c2a3110015e291fdc5d502d (diff)
downloadpoky-04d1ad5fe7f5029a5b46a10ef18f7f335c17474b.tar.gz
poky-04d1ad5fe7f5029a5b46a10ef18f7f335c17474b.tar.bz2
poky-04d1ad5fe7f5029a5b46a10ef18f7f335c17474b.zip
bitbake: toaster: admin Add Layer_Version to the admin-able models
If the migration didn't get the release conversion right for say, a local or imported layer it would be handy to be able to edit this in the django admin page. Also useful for developers to be able to tweak layers on the fly. (Bitbake rev: 0b23b6919ef1162a0c7fb5b5a961a24653c51eb2) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm/models.py')
-rw-r--r--bitbake/lib/toaster/orm/models.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 72b9dfeaa8..caacc2a544 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1252,6 +1252,9 @@ class Release(models.Model):
def __unicode__(self):
return "%s (%s)" % (self.name, self.branch_name)
+ def __str__(self):
+ return self.name
+
class ReleaseDefaultLayer(models.Model):
release = models.ForeignKey(Release)
layer_name = models.CharField(max_length=100, default="")
@@ -1419,6 +1422,14 @@ class Layer_Version(models.Model):
def __unicode__(self):
return ("id %d belongs to layer: %s" % (self.pk, self.layer.name))
+ def __str__(self):
+ if self.release:
+ release = self.release.name
+ else:
+ release = "No release set"
+
+ return "%d %s (%s)" % (self.pk, self.layer.name, release)
+
class LayerVersionDependency(models.Model):