[ create a new paste ] login | about

Link: http://codepad.org/VEC2FBSk    [ raw code | fork ]

Python, pasted on Jan 13:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Fields to Return
fields = ['id', 'code', 'sg_status_list']

# Condition Group 1
condition_1_1 = { 'path' : 'sg_status_list' , 'relation' : 'is', 'values' : ['hld'] }
condition_group_1 = { 'logical_operator' : 'and' , 'conditions' : [condition_1_1] }

# Condition Group 2
condition_2_1 = { 'path' : "sg_status_list" , 'relation' : "is" , 'values' : ["ip"] }
condition_2_2 = { 'path' : "code" , 'relation' : 'contains' , 'values' : ["shot"] }
condition_2_3 = { 'path' : 'code' , 'relation' : 'contains' , 'values' : ['Test'] }
condition_group_2 = { 'logical_operator' : 'and' , 'conditions' : [ condition_2_1 , condition_2_2, condition_group_2 ] }

# Adding the Groups together using 'or'
filters = { 'logical_operator' : 'or' , 'conditions' : [ condition_group_1, condition_group_2 ] }

# Running the find
shots = sg.find('Shot',filters,fields)


Create a new paste based on this one


Comments: