diff options
author | Michael Wood <michael.g.wood@intel.com> | 2016-12-09 16:52:44 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-12 20:44:53 +0000 |
commit | 90d995c63717f869ef68976f7d0778e87af989f2 (patch) | |
tree | 46d437d1606dd7c4bc3c64e555cb9074bd6ff665 /bitbake/lib | |
parent | 9dbcc0fbb30354e1de6253cf5bb9a5ddd1bc32eb (diff) | |
download | poky-90d995c63717f869ef68976f7d0778e87af989f2.tar.gz |
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')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 8 |
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): | |||
1493 | return self.commit | 1493 | return self.commit |
1494 | return 'N/A' | 1494 | return 'N/A' |
1495 | 1495 | ||
1496 | def get_detailspage_url(self, project_id): | 1496 | def get_detailspage_url(self, project_id=None): |
1497 | """ returns the url to the layer details page uses own project | ||
1498 | field if project_id is not specified """ | ||
1499 | |||
1500 | if project_id is None: | ||
1501 | project_id = self.project.pk | ||
1502 | |||
1497 | return reverse('layerdetails', args=(project_id, self.pk)) | 1503 | return reverse('layerdetails', args=(project_id, self.pk)) |
1498 | 1504 | ||
1499 | def get_alldeps(self, project_id): | 1505 | def get_alldeps(self, project_id): |