Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BRANCH 4.0:

   updated and simplified ExpressionFilterElementWdg to assume using @SEARCH() expression
  • Loading branch information...
commit 289787578330f2ebd8347b9ae9129d73a6a8a8f2 1 parent 0daab92
@oboreo oboreo authored
Showing with 10 additions and 25 deletions.
  1. +10 −25 src/tactic/ui/filter/filter_element_wdg.py
View
35 src/tactic/ui/filter/filter_element_wdg.py
@@ -1156,28 +1156,18 @@ class ExpressionFilterElementWdg(BaseFilterElementWdg):
def alter_search(my, search):
- prefix = my.values.get("prefix")
+ #prefix = my.values.get("prefix")
#column = my.values.get("%s_column" % prefix)
+ if not my.values.get('option'):
+ return
+ expr = my.get_option("expression")
+ # e.g. @SEARCH(vfx/asset['code','EQ','002'])
+ from pyasm.biz import ExpressionParser
+ parser = ExpressionParser()
+ expr_search = parser.eval(expr)
+ search.add_relationship_search_filter(expr_search)
-
-
- option = my.values.get("option")
- if option == 'my_items':
- expr = my.get_option("expression")
- column = my.get_option("column")
-
-
- from pyasm.biz import ExpressionParser
- parser = ExpressionParser()
- value = my.values.get("value")
- if results:
- search.add_filters(column, results)
- else:
- search.add_filter(column, 'NULL')
-
- elif option == 'all_items':
- pass
def get_display(my):
@@ -1189,14 +1179,9 @@ def get_display(my):
div = SpanWdg()
div.add("%s: " % title)
checkbox = CheckboxWdg("option")
- checkbox.set_attr("value", "my_items")
+ checkbox.set_attr("value", "expr_items")
checkbox.set_checked()
div.add(checkbox)
- div.add("  ")
- div.add("All")
- checkbox = CheckboxWdg("option")
- checkbox.set_attr("value", "all_items")
- div.add(checkbox)
return div
Please sign in to comment.
Something went wrong with that request. Please try again.