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)
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)
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)