Пример #1
0
def list():
    redis = sessions.Sessions()
    redis.add(datetime.now())

    datastore = notes.Notes()

    if request.method == 'POST':
        note = request.data

        result = datastore.create(note)

        return note, status.HTTP_201_CREATED

    return datastore.find()
Пример #2
0
def listas():
    redis = sessions.Sessions()
    print("debugeo", datetime.now())
    redis.add(str(datetime.now()))

    mongodb = libros.Libros()

    #if request.method == 'GET':
    note = request.data

    result = mongodb.create(note)

    # Se adicionó para poder manejar ObjectID
    note['_id'] = str(note['_id'])

    return note, status.HTTP_201_CREATED
Пример #3
0
def list():
    redis = sessions.Sessions()
    redis.add(str(datetime.now()))

    mongodb = notes.Notes()

    if request.method == 'POST':
        note = request.data

        result = mongodb.create(note)

        # Se adicionó para poder manejar ObjectID
        note['_id'] = str(note['_id'])

        return note, status.HTTP_201_CREATED

    return mongodb.find()
Пример #4
0
def active_sessions():
    redis = sessions.Sessions()
    dbsize = redis.get_active_sessions()

    return jsonify({"Sesiones activas: ": dbsize})