如何通过Python酒店会议室预定系统进行在线预约?
- 内容介绍
- 文章标签
- 相关推荐
本文共计385个文字,预计阅读时间需要2分钟。
建议预定系统 + 源码下载:一、说明 + 实例提供2个版本 + Python2.7 + Python3(只需是Python3即可)+ 使用Django实现的,运行后使用浏览器访问即可 + 二、运行效果 + 三、部分示例代码 + def bookin
会议室预定系统 源码下载:
一、说明
本实例提供2个版本
- Python2.7
- Python3(只要是Python3就可以)
使用Django实现的,运行之后使用浏览器访问即可
二、运行效果
三、部分示例代码
def booking(request):"""
获取会议室预定情况以及预定会议室
:param request:
:param date:
:return:
"""
ret = {'code': 1000, 'msg': None, 'data': None}
current_date = datetime.datetime.now().date()
if request.method == "GET":
try:
fetch_date = request.GET.get('date')
fetch_date = datetime.datetime.strptime(fetch_date, '%Y-%m-%d').date()
if fetch_date < current_date:
raise Exception('查询时间不能是以前的时间')
booking_list = models.Booking.objects.filter(booking_date=fetch_date).select_related('user',
'room').order_by(
'booking_time')
booking_dict = {}
for item in booking_list:
if item.room_id not in booking_dict:
booking_dict[item.room_id] = {item.booking_time: {'name': item.user.name, 'id': item.user.id}}
else:
if item.booking_time not in booking_dict[item.room_id]:
booking_dict[item.room_id][item.booking_time] = {'name': item.user.name, 'id': item.user.id}
会议室预定系统源码下载:
长按左侧二维码 2 秒
回复「会议」即可获取源码
(非本号)
本文共计385个文字,预计阅读时间需要2分钟。
建议预定系统 + 源码下载:一、说明 + 实例提供2个版本 + Python2.7 + Python3(只需是Python3即可)+ 使用Django实现的,运行后使用浏览器访问即可 + 二、运行效果 + 三、部分示例代码 + def bookin
会议室预定系统 源码下载:
一、说明
本实例提供2个版本
- Python2.7
- Python3(只要是Python3就可以)
使用Django实现的,运行之后使用浏览器访问即可
二、运行效果
三、部分示例代码
def booking(request):"""
获取会议室预定情况以及预定会议室
:param request:
:param date:
:return:
"""
ret = {'code': 1000, 'msg': None, 'data': None}
current_date = datetime.datetime.now().date()
if request.method == "GET":
try:
fetch_date = request.GET.get('date')
fetch_date = datetime.datetime.strptime(fetch_date, '%Y-%m-%d').date()
if fetch_date < current_date:
raise Exception('查询时间不能是以前的时间')
booking_list = models.Booking.objects.filter(booking_date=fetch_date).select_related('user',
'room').order_by(
'booking_time')
booking_dict = {}
for item in booking_list:
if item.room_id not in booking_dict:
booking_dict[item.room_id] = {item.booking_time: {'name': item.user.name, 'id': item.user.id}}
else:
if item.booking_time not in booking_dict[item.room_id]:
booking_dict[item.room_id][item.booking_time] = {'name': item.user.name, 'id': item.user.id}
会议室预定系统源码下载:
长按左侧二维码 2 秒
回复「会议」即可获取源码
(非本号)

