Remove extra argument.
This commit is contained in:
parent
1ad8c848c4
commit
1d8699df94
|
@ -69,7 +69,7 @@ def select_all_frames(conn):
|
||||||
rows = cur.fetchall()
|
rows = cur.fetchall()
|
||||||
return rows
|
return rows
|
||||||
|
|
||||||
def select_frames(conn, n, from_, url_params):
|
def select_frames(conn, n, url_params):
|
||||||
|
|
||||||
# Should pass this a dict of fields and values (request.args)
|
# Should pass this a dict of fields and values (request.args)
|
||||||
# TODO clean data before sending to DB
|
# TODO clean data before sending to DB
|
||||||
|
@ -109,11 +109,10 @@ class Packets(Resource):
|
||||||
n = int(request.args.get('n'))
|
n = int(request.args.get('n'))
|
||||||
except:
|
except:
|
||||||
n = 10
|
n = 10
|
||||||
from_ = None if request.args.get('from') == None else request.args.get('from')
|
|
||||||
|
|
||||||
conn = get_db_connection()
|
conn = get_db_connection()
|
||||||
# Limit to number of records requested
|
# Limit to number of records requested
|
||||||
data = select_frames(conn, n = n, from_ = from_, url_params = request.args.to_dict())
|
data = select_frames(conn, n = n, url_params = request.args.to_dict())
|
||||||
# Sort by created date, descending (https://stackoverflow.com/a/45266808)
|
# Sort by created date, descending (https://stackoverflow.com/a/45266808)
|
||||||
#data.sort(key=operator.itemgetter('created'), reverse=True)
|
#data.sort(key=operator.itemgetter('created'), reverse=True)
|
||||||
return {'data':data}, 200 # return data and 200 OK code
|
return {'data':data}, 200 # return data and 200 OK code
|
||||||
|
|
Loading…
Reference in New Issue
Block a user