[bitbake-devel] [PATCH 01/12] bitbake: toaster: orm Add util function to return the url to layerversion
Ed Bartosh
ed.bartosh at linux.intel.com
Tue Aug 4 19:46:29 UTC 2015
From: Michael Wood <michael.g.wood at intel.com>
Save duplicating this call and make a utility function for it on the
Layer_Version object.
Signed-off-by: Michael Wood <michael.g.wood at intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
lib/toaster/orm/models.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 2d7ef09..3b72f80 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -23,6 +23,7 @@ from django.db import models
from django.db.models import F, Q, Avg
from django.utils import timezone
+from django.core.urlresolvers import reverse
from django.core import validators
from django.conf import settings
@@ -1109,6 +1110,9 @@ class Layer_Version(models.Model):
return self.up_branch.name
return ("Cannot determine the vcs_reference for layer version %s" % vars(self))
+ def get_detailspage_url(self, project_id):
+ return reverse('layerdetails', args=(project_id, self.pk))
+
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")
--
2.1.4
More information about the bitbake-devel
mailing list