Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
0a28c938
Commit
0a28c938
authored
Oct 18, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: InstanceTree_getSoftwareProduct also return release and type variations
parent
78386ad8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/InstanceTree_getDefaultImageAbsoluteUrl.py
...s/slapos_cloud/InstanceTree_getDefaultImageAbsoluteUrl.py
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/InstanceTree_getSoftwareProduct.py
...tal_skins/slapos_cloud/InstanceTree_getSoftwareProduct.py
+16
-4
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/InstanceTree_getDefaultImageAbsoluteUrl.py
View file @
0a28c938
# set default value of image_url to the panel's logo
image_url
=
"gadget_slapos_panel.png"
software_product
=
context
.
InstanceTree_getSoftwareProduct
()
software_product
,
_
,
_
=
context
.
InstanceTree_getSoftwareProduct
()
if
software_product
is
not
None
:
product_image_url
=
software_product
.
getDefaultImageAbsoluteUrl
()
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/InstanceTree_getSoftwareProduct.py
View file @
0a28c938
portal
=
context
.
getPortalObject
()
url_string
=
context
.
getUrlString
()
software_product
=
None
software_release
=
None
software_type
=
None
product_list
=
portal
.
portal_catalog
(
portal_type
=
"Software Product"
,
...
...
@@ -9,13 +11,23 @@ product_list = portal.portal_catalog(
follow_up__uid
=
context
.
getFollowUpUid
()
)
release
=
portal
.
portal_catalog
.
getResultValue
(
software_
release
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Software Product Release Variation"
,
url_string
=
url_string
,
parent_uid
=
[
x
.
getUid
()
for
x
in
product_list
]
)
if
release
is
not
None
:
software_product
=
release
.
getParentValue
()
if
software_
release
is
not
None
:
software_product
=
software_
release
.
getParentValue
()
return
software_product
software_type
=
portal
.
portal_catalog
.
getResultValue
(
parent_uid
=
software_product
.
getUid
(),
title
=
context
.
getSourceReference
(),
portal_type
=
"Software Product Type Variation"
)
if
software_type
is
None
:
software_release
=
None
software_product
=
None
return
software_product
,
software_release
,
software_type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment