summaryrefslogtreecommitdiff
path: root/horizon/dashboards/nova/containers/tables.py
diff options
context:
space:
mode:
authorKe WU <ke.wu@ibeca.me>2012-06-13 18:41:28 -0700
committerKe Wu <ke.wu@ibeca.me>2012-06-18 16:51:32 -0700
commit359a71e0b05eed4b04df625d72ed0eca3f916a30 (patch)
tree81db3e179903f34022231f57c95e2c02238d6a4c /horizon/dashboards/nova/containers/tables.py
parentf6f2a91e14f6bdd4e1a87e31a1d6923127afee1b (diff)
downloadtuskar-ui-359a71e0b05eed4b04df625d72ed0eca3f916a30.tar.gz
Swift Object filter improve and fix
bug#1013409 bug#1013412 Change-Id: Ib2efa534622793bfa9f190d74e3b91cc66e7516a
Diffstat (limited to 'horizon/dashboards/nova/containers/tables.py')
-rw-r--r--horizon/dashboards/nova/containers/tables.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/horizon/dashboards/nova/containers/tables.py b/horizon/dashboards/nova/containers/tables.py
index 5b03be89..3b357b6c 100644
--- a/horizon/dashboards/nova/containers/tables.py
+++ b/horizon/dashboards/nova/containers/tables.py
@@ -138,15 +138,14 @@ class DownloadObject(tables.LinkAction):
class ObjectFilterAction(tables.FilterAction):
def filter(self, table, objects, filter_string):
- """ Really naive case-insensitive search. """
- q = filter_string.lower()
-
- def comp(object):
- if q in object.name.lower():
- return True
- return False
-
- return filter(comp, objects)
+ request = table._meta.request
+ container = self.table.kwargs['container_name']
+ subfolder = self.table.kwargs['subfolder_path']
+ path = subfolder + '/' if subfolder else ''
+ return api.swift_filter_objects(request,
+ filter_string,
+ container,
+ path=path)
def sanitize_name(name):