diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-08-04 22:46:29 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-06 16:04:43 -0500 |
commit | d3b9927a3cfc5adbfbb1fe88378ed8dde7644a8c (patch) | |
tree | 22d31af4b2854420196bd1879fedda9fc949e693 /bitbake | |
parent | c8bc7ee6ed3fd6730abeb4aa11544f6398f73be0 (diff) | |
download | poky-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>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 4 |
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 | |||
23 | from django.db.models import F, Q, Avg | 23 | from django.db.models import F, Q, Avg |
24 | from django.utils import timezone | 24 | from django.utils import timezone |
25 | 25 | ||
26 | from django.core.urlresolvers import reverse | ||
26 | 27 | ||
27 | from django.core import validators | 28 | from django.core import validators |
28 | from django.conf import settings | 29 | from 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 | ||