Ejemplo n.º 1
0
 def seats(self):
     hid = request.args.get('hid')
     hall = Hall.get(hid)
     if not hall:
         return Code.hall_dose_not_exist, request.args
     hall.seats = Seat.query.filter_by(hid=hid).all()
     return hall
Ejemplo n.º 2
0
 def seats(self):
     hid = request.args.get('hid')
     hall = Hall.get(hid)
     if not hall:
         # 都是自定了 返回的错误提示,而且返回了输入的参数,而且还是软编码,错误类型会写文档提示
         return Code.hall_does_not_exist, request.args
     hall.seats = Seat.query.filter_by(hid=hid).all()
     return hall
Ejemplo n.º 3
0
 def seats(self):
     hid = request.args["hid"]
     hall = Hall.get(hid)
     if not hall:
         # return jsonify({"msg":"hall %s is not found"%hid})
         return Code.hall_does_not_exist, request.args
     hall.seats = Seat.query.filter_by(hid=hid).all()
     return hall
Ejemplo n.º 4
0
 def seats(self):
     hid = request.params['hid']
     hall = Hall.get(hid)
     if not hall:
         return Code.hall_does_not_exist, {'hid': hid}
     hall.seats = Seat.query.filter(
         Seat.hid == hid, Seat.seat_type != SeatType.road.value).all()
     return hall
Ejemplo n.º 5
0
 def seat(self):
     hid = request.args['hid']
     # 接受影厅id,找到这个影厅
     hall = Hall.get(hid)
     if not hall:
         return Code.hall_does_not_exist
     hall.seats = Seat.query.filter(
         Seat.hid == hid, Seat.seat_type != SeatType.road.value).all()
     # hall.seats_num = Seat.query.filter_by(hid=hid).all()
     # cinema.halls = Hall.query.filter_by(cid=cid).all()
     return hall