示例#1
0
def roles_index():
    form = SearchForm()
    roles = Role.query.all()
    if form.validate_on_submit():

        search = form.search.data
        roles = Role.query.filter((Role.name.like('%'+search+'%'))).all()

    return render_template('roles/index.html',form=form,roles=roles)
示例#2
0
def reservations_index():
    form = SearchForm(request.form)
    reservations = Reservation.query.all()
    if form.validate_on_submit():
        search = form.search.data
        reservations = Reservation.query.filter(or_(
            Reservation.amount.like('%'+search+'%'),
            Reservation.passenger_id.like('%'+search+'%'))).all()

    return render_template('reservations/index.html',form=form,reservations=reservations)
示例#3
0
def rooms_index():
    form = SearchForm()
    rooms = Rooms.query.all()

    if form.validate_on_submit():

        search = form.search.data
        rooms = Rooms.query.filter(or_(
            Rooms.room_type.like('%'+search+'%'),
            Rooms.status.like('%'+search+'%'),
            Rooms.price.like('%'+search+'%'))).all()

    return render_template('rooms/index.html', form = form, rooms=rooms)
示例#4
0
def users_index():
    form = SearchForm()
    users = User.query.all()

    if form.validate_on_submit():

        search = form.search.data
        users = User.query.filter(or_(
            User.firstname.like('%'+search+'%'),
            User.lastname.like('%'+search+'%'),
            User.mobile.like('%'+search+'%'),
            User.role.like('%'+search+'%'),
            User.email.like('%'+search+'%'))).all()

    return render_template('users/index.html', form = form, users=users)