summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/models.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-12-09 16:52:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-12 20:44:53 +0000
commit90d995c63717f869ef68976f7d0778e87af989f2 (patch)
tree46d437d1606dd7c4bc3c64e555cb9074bd6ff665 /bitbake/lib/toaster/orm/models.py
parent9dbcc0fbb30354e1de6253cf5bb9a5ddd1bc32eb (diff)
downloadpoky-90d995c63717f869ef68976f7d0778e87af989f2.tar.gz
poky-90d995c63717f869ef68976f7d0778e87af989f2.tar.bz2
poky-90d995c63717f869ef68976f7d0778e87af989f2.zip
bitbake: toaster: models Layer_Version get_detailspage_url optional project_id
Allow passing none as the project id, this is convenient for layers which belong to projects already and therefore have their own project field. Add documentation string to function (Bitbake rev: 78dc7b9f1801e7f4c266ba1369e5706f177ddaa1) Signed-off-by: Michael Wood <michael.g.wood@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.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 4cd6683c32..98745d69f6 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1493,7 +1493,13 @@ class Layer_Version(models.Model):
return self.commit
return 'N/A'
- def get_detailspage_url(self, project_id):
+ def get_detailspage_url(self, project_id=None):
+ """ returns the url to the layer details page uses own project
+ field if project_id is not specified """
+
+ if project_id is None:
+ project_id = self.project.pk
+
return reverse('layerdetails', args=(project_id, self.pk))
def get_alldeps(self, project_id):