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
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
fd51e6db
Commit
fd51e6db
authored
Sep 05, 2012
by
Romain Courteaud
Committed by
Cédric de Saint Martin
Sep 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to filter computer by their categories
parent
a237b406
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 @
fd51e6db
...
...
@@ -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 @
fd51e6db
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