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
0
Merge Requests
0
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
Jérome Perrin
slapos.core
Commits
998baa17
Commit
998baa17
authored
Sep 05, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to filter computer by their categories
parent
3795c902
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/OpenSaleOrder_findPartition.xml
...m/portal_skins/vifib_base/OpenSaleOrder_findPartition.xml
+27
-2
master/bt5/vifib_base/bt/revision
master/bt5/vifib_base/bt/revision
+1
-1
No files found.
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_base/OpenSaleOrder_findPartition.xml
View file @
998baa17
...
...
@@ -70,10 +70,10 @@ else:\n
software_instance_portal_type \n
# support SLA\n
if "computer_guid" in filter_kw:\n
query_kw["parent_reference"] = filter_kw
["computer_guid"]
\n
query_kw["parent_reference"] = filter_kw
.pop("computer_guid")
\n
if "instance_guid" in filter_kw:\n
portal = context.getPortalObject()\n
instance = portal.portal_catalog.getResultValue(portal_type="Software Instance", reference=filter_kw
["instance_guid"]
)\n
instance = portal.portal_catalog.getResultValue(portal_type="Software Instance", reference=filter_kw
.pop("instance_guid")
)\n
if instance is None:\n
# XXX Other user do not have access to the instance document...\n
if filter_kw["instance_guid"] == "SOFTINST-9238":\n
...
...
@@ -91,6 +91,31 @@ if "instance_guid" in filter_kw:\n
else:\n
query_kw["uid"] = "-1"\n
\n
computer_base_category_list = [\n
\'cpu_core\',\n
\'cpu_frequency\',\n
\'cpu_type\',\n
\'local_area_network_type\',\n
\'memory_size\',\n
\'memory_type\',\n
\'storage_capacity\',\n
\'storage_interface\',\n
\'storage_redundancy\',\n
]\n
for base_category in computer_base_category_list:\n
if base_category in filter_kw:\n
category_relative_url = "%s" % filter_kw.pop(base_category)\n
# XXX Small protection to prevent entering strange strings\n
category = context.getPortalObject().portal_categories[base_category].restrictedTraverse(category_relative_url, None)\n
if category is None:\n
query_kw["uid"] = "-1"\n
else:\n
query_kw["%s_uid" % base_category] = category.getUid()\n
\n
if filter_kw.keys():\n
# XXX Drop all unexpected keys\n
query_kw["uid"] = "-1"\n
\n
SQL_WINDOW_SIZE = 50\n
\n
# fetch at mot 50 random Computer Partitions, and check if they are ok\n
...
...
master/bt5/vifib_base/bt/revision
View file @
998baa17
471
\ No newline at end of file
472
\ No newline at end of file
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