Example #1
0
 def steps(self):
     toad_data = database.exec_sql(self.toad_query)
     check_in_data = database.exec_sql(self.check_in_query)
     adm_data = database.exec_sql(self.adm_query)
     piscine_data = database.exec_sql(self.piscine_query)
     data = [
         dict(step="toad", count=toad_data[0]["count"]),
         dict(step="check-in", count=check_in_data[0]["count"]),
         dict(step="adm", count=adm_data[0]["count"]),
         dict(step="piscine", count=piscine_data[0]["count"])
     ]
     return data
Example #2
0
 def step(self, step_name):
     step_dict = {
         "toad": 198,
         "check-in": 3293,
         "adm": 199,
         "piscine": 26
     }
     return database.exec_sql(self.step_query % step_dict[step_name])
Example #3
0
 def daily(self, start: str, end: str):
     return database.exec_sql(self.per_day_query % (start, end))
Example #4
0
 def gender(self):
     gender_data = database.exec_sql(self.gender_query)
     return gender_data
Example #5
0
 def weekly(self):
     per_week_data = database.exec_sql(self.per_week_query)
     for i in range(len(per_week_data)):
         per_week_data[i]['last_day'] = datetime.strptime(
             per_week_data[i]['week'] + "-7", "%G-%V-%u")
     return per_week_data
Example #6
0
 def monthly(self):
     per_week_data = database.exec_sql(self.per_month_query)
     return per_week_data
Example #7
0
 def languages(self):
     languages_data = database.exec_sql(self.languages_query)
     return languages_data
Example #8
0
 def source_channels(self):
     source_channels_data = database.exec_sql(self.source_channels_query)
     return source_channels_data
Example #9
0
 def ages(self):
     ages_data = database.exec_sql(self.ages_query)
     return ages_data
Example #10
0
 def projects(self, project_type):
     data = database.exec_sql(self.project_query % project_type)
     return data