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
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):
1252 def __unicode__(self): 1252 def __unicode__(self):
1253 return "%s (%s)" % (self.name, self.branch_name) 1253 return "%s (%s)" % (self.name, self.branch_name)
1254 1254
1255 def __str__(self):
1256 return self.name
1257
1255class ReleaseDefaultLayer(models.Model): 1258class ReleaseDefaultLayer(models.Model):
1256 release = models.ForeignKey(Release) 1259 release = models.ForeignKey(Release)
1257 layer_name = models.CharField(max_length=100, default="") 1260 layer_name = models.CharField(max_length=100, default="")
@@ -1419,6 +1422,14 @@ class Layer_Version(models.Model):
1419 def __unicode__(self): 1422 def __unicode__(self):
1420 return ("id %d belongs to layer: %s" % (self.pk, self.layer.name)) 1423 return ("id %d belongs to layer: %s" % (self.pk, self.layer.name))
1421 1424
1425 def __str__(self):
1426 if self.release:
1427 release = self.release.name
1428 else:
1429 release = "No release set"
1430
1431 return "%d %s (%s)" % (self.pk, self.layer.name, release)
1432
1422 1433
1423class LayerVersionDependency(models.Model): 1434class LayerVersionDependency(models.Model):
1424 1435