@@ -12,21 +12,22 @@ def list_data(params):
12
12
technology_array = convert_to_array (params ['technology' ])
13
13
data = []
14
14
15
- for technology in technology_array :
16
- query = DB .collection (TABLE )
15
+ query = DB .collection (TABLE )
17
16
18
- if 'start' in params :
19
- query = query .where (filter = FieldFilter ('date' , '>=' , params ['start' ]))
20
- if 'end' in params :
21
- query = query .where (filter = FieldFilter ('date' , '<=' , params ['end' ]))
17
+ if 'start' in params :
18
+ query = query .where (filter = FieldFilter ('date' , '>=' , params ['start' ]))
19
+ if 'end' in params :
20
+ query = query .where (filter = FieldFilter ('date' , '<=' , params ['end' ]))
22
21
23
- query = query .where (filter = FieldFilter ('geo' , '==' , params ['geo' ]))
24
- query = query .where (filter = FieldFilter ('rank' , '==' , params ['rank' ]))
22
+ query = query .where (filter = FieldFilter ('geo' , '==' , params ['geo' ]))
23
+ query = query .where (filter = FieldFilter ('rank' , '==' , params ['rank' ]))
24
+
25
+ for technology in technology_array :
25
26
query = query .where (filter = FieldFilter ('technology' , '==' , technology ))
26
27
27
- documents = query .stream ()
28
+ documents = query .stream ()
28
29
29
- for doc in documents :
30
- data .append (doc .to_dict ())
30
+ for doc in documents :
31
+ data .append (doc .to_dict ())
31
32
32
33
return Result (result = data )
0 commit comments