コード例 #1
0
def getAllLogs():
    results = logs.find().sort("date")
    output = []
    if results.count() == 0:
        output.append({'data' : 'Still no data in the database'})
    else:
        output = appendLogResults(results, output)
    return jsonify(output)
コード例 #2
0
def getLogsByEmail(email):
    dbquery = {"affected_email": email}
    results = logs.find(dbquery).sort("date")
    output = []
    if results.count() == 0:
        output.append({'data' : 'No results were found'})
    else:
        output = appendLogResults(results, output)
    return jsonify(output)
コード例 #3
0
def getLogsByEvent(event):
    dbquery = {"event": event}
    results = logs.find(dbquery).sort("date")
    output = []
    if results.count() == 0:
        output.append({'data' : 'No results were found'})
    else:
        output = appendLogResults(results, output)
    return jsonify(output)