Exemplo n.º 1
0
def latest(**kwargs):
    docs = document.latest(notedb())
    return jsonresponse([{
        "id": doc[0],
        "text": doc[1],
        "date": doc[2]
    } for doc in docs], indent=4)
Exemplo n.º 2
0
def search(request, **kwargs):
    query = request.args.get("q", "")
    result = document.search(notedb(), xapdb, query)
    return jsonresponse(result)