1
This commit is contained in:
parent
8d71ef15e1
commit
f8b2b6ce77
@ -28,7 +28,7 @@ class UserAnalysis:
|
||||
self.zone_time: int = 0
|
||||
self.data_in = data_in
|
||||
|
||||
self.global_filters = None
|
||||
self.global_filters = []
|
||||
self.groupby = None
|
||||
self.time_particle = None
|
||||
self.date_range = None
|
||||
@ -106,6 +106,16 @@ class UserAnalysis:
|
||||
elif comparator == '!=':
|
||||
where.append(col != ftv[0])
|
||||
|
||||
elif comparator == 'like':
|
||||
where.append(col.like(f'%{ftv[0]}%'))
|
||||
|
||||
elif comparator == 'not like':
|
||||
where.append(col.notlike(f'%{ftv[0]}%'))
|
||||
|
||||
elif comparator == 'in':
|
||||
where.append(col.in_(ftv))
|
||||
|
||||
|
||||
return where
|
||||
|
||||
def property_model(self):
|
||||
@ -129,7 +139,7 @@ class UserAnalysis:
|
||||
func.round(getattr(func, analysis)(getattr(self.user_tbl.c, event['quota'])), 2).label(
|
||||
'values')]
|
||||
|
||||
where = self._get_filters(event['filts'])
|
||||
where = self._get_filters(event['filts']+self.global_filters)
|
||||
qry = sa.select((*self.groupby, *selectd)).where(*where)
|
||||
|
||||
qry = qry.group_by(*self.groupby)
|
||||
|
Loading…
Reference in New Issue
Block a user