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()
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
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()
def active_sessions(): redis = sessions.Sessions() dbsize = redis.get_active_sessions() return jsonify({"Sesiones activas: ": dbsize})