コード例 #1
0
def select_all_from(table_name, limit = -1):
  query = ''
  if limit != -1:
    query = "SELECT * FROM {} LIMIT {}".format(table_name, limit)
  else:
    query = "SELECT * FROM {}".format(table_name)
  print(query)
  return session.execute(query)
コード例 #2
0
def get_and_store_login_data(selected_month):
    rows = session.execute(admin_queries["logins_over_time"], [selected_month])
    df = DataFrame(rows)
    jsonified_data = df.to_json(date_format="iso")
    hidden_data_div = html.Div(id="jsonified-login-df",
                               children=jsonified_data,
                               style={"display": "none"})
    graph = dcc.Graph(id="user_activity_graph")
    return [hidden_data_div, graph]
コード例 #3
0
def get_and_store_usage_data(selected_month):
  rows = session.execute(admin_queries['data_usage_by_month'], [selected_month])
  df = DataFrame(rows)
  jsonified_data = df.to_json(date_format='iso')
  hidden_data_div = html.Div(id='jsonified-data-usage-df', 
                             children=jsonified_data, 
                             style={'display' : 'none'})
  graph=dcc.Graph(id='data_usage_graph')
  return [hidden_data_div, graph]
コード例 #4
0
def get_and_store_login_data(selected_month):
  rows = session.execute(admin_queries['logins_over_time'], [selected_month])
  df = DataFrame(rows)
  jsonified_data = df.to_json(date_format='iso')
  hidden_data_div = html.Div(id='jsonified-login-df', 
                             children=jsonified_data, 
                             style={'display': 'none'})
  graph=dcc.Graph(id='user_activity_graph')
  return [hidden_data_div, graph]
コード例 #5
0
def get_and_store_usage_data(selected_month):
    rows = session.execute(admin_queries["data_usage_by_month"],
                           [selected_month])
    df = DataFrame(rows)
    jsonified_data = df.to_json(date_format="iso")
    hidden_data_div = html.Div(id="jsonified-data-usage-df",
                               children=jsonified_data,
                               style={"display": "none"})
    graph = dcc.Graph(id="data_usage_graph")
    return [hidden_data_div, graph]
コード例 #6
0
def get_and_store_usage_data(selected_month):
    rows = session.execute(admin_queries['data_usage_by_month'],
                           [selected_month])
    df = DataFrame(rows)
    return df.to_json(date_format='iso')
コード例 #7
0
def get_and_store_login_data(selected_month):
    rows = session.execute(admin_queries['logins_over_time'], [selected_month])
    df = DataFrame(rows)
    return df.to_json(date_format='iso')
コード例 #8
0
def make_queries_get_df (query):
  rows = session.execute(query)
  return to_df(rows)
コード例 #9
0
def make_queries_get_df(query):
    rows = session.execute(query, timeout=None)
    return to_df(rows)