def get_all_sessions(): data = [] dbRows = select_all_sessions(c) for row in dbRows: data.append({ 'ip': row['ip'], 'continent': row['continent'], 'country': row['country'], 'city': row['city'], 'os': row['os'], 'browser': row['browser'], 'session': row['session'], 'time': row['created_at'] }) return jsonify(data)
def get_all_sessions(): """ Getting all the session details of the user """ data = [] dbRows = select_all_sessions(c) for row in dbRows: data.append({ 'ip': row.get('ip', ''), 'continent': row.get('continent', ''), 'country': row.get('country', ''), 'city': row.get('city', ''), 'os': row.get('os', ''), 'browser': row.get('browser', ''), 'session': row.get('session', ''), 'time': row.get('created_at', '') }) return jsonify(data)