summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-08-04 22:46:29 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-06 16:04:43 -0500
commitd3b9927a3cfc5adbfbb1fe88378ed8dde7644a8c (patch)
tree22d31af4b2854420196bd1879fedda9fc949e693
parentc8bc7ee6ed3fd6730abeb4aa11544f6398f73be0 (diff)
downloadpoky-d3b9927a3cfc5adbfbb1fe88378ed8dde7644a8c.tar.gz
bitbake: toaster: orm Add util function to return the url to layerversion
Save duplicating this call and make a utility function for it on the Layer_Version object. (Bitbake rev: 32d382315bad37cebbe67ca3287085f3d856a9ed) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/orm/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 2d7ef09bb1..3b72f802a0 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -23,6 +23,7 @@ from django.db import models
23from django.db.models import F, Q, Avg 23from django.db.models import F, Q, Avg
24from django.utils import timezone 24from django.utils import timezone
25 25
26from django.core.urlresolvers import reverse
26 27
27from django.core import validators 28from django.core import validators
28from django.conf import settings 29from django.conf import settings
@@ -1109,6 +1110,9 @@ class Layer_Version(models.Model):
1109 return self.up_branch.name 1110 return self.up_branch.name
1110 return ("Cannot determine the vcs_reference for layer version %s" % vars(self)) 1111 return ("Cannot determine the vcs_reference for layer version %s" % vars(self))
1111 1112
1113 def get_detailspage_url(self, project_id):
1114 return reverse('layerdetails', args=(project_id, self.pk))
1115
1112 def __unicode__(self): 1116 def __unicode__(self):
1113 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") 1117 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")
1114 1118