コード例 #1
0
def rooms():
    print 'In rooms page'
    space_controller = SpaceController()
    room_controller = RoomController()
    args = request.args
    space_id = args.get('space', '')
    space = space_controller.get_item(space_id=space_id)
    rooms = room_controller.get_items(space_id=space_id)
    user = UserController().get_item(session['email']) if 'email' in session else None
    return render_template("rooms.html", space=space, rooms=rooms, user=user)
コード例 #2
0
def book():
    print 'In book page'
    space_controller = SpaceController()
    room_controller = RoomController()
    args = request.args
    space_id = args.get('space', '')
    room_id = args.get('room', '')
    space = space_controller.get_item(space_id)
    room = room_controller.get_item(space_id, room_id)
    user = UserController().get_item(session['email']) if 'email' in session else None
    date = datetime.datetime.today().strftime("%Y-%m-%d")
    print date
    return render_template("book.html", space=space, room=room, user=user, date=date)