本文整理汇总了Python中models.Room.room_type方法的典型用法代码示例。如果您正苦于以下问题:Python Room.room_type方法的具体用法?Python Room.room_type怎么用?Python Room.room_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Room
的用法示例。
在下文中一共展示了Room.room_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: index
# 需要导入模块: from models import Room [as 别名]
# 或者: from models.Room import room_type [as 别名]
def index():
form = SearchForm()
if form.validate_on_submit():
room = Room()
form.populate_obj(room)
# Change room_pref and room_type if they are None
if not room.room_pref:
room.room_pref = 0 if room.is_available else 1
if not room.room_type:
room.room_type = 1 if room.is_available else 0
# Search for matching rooms
rooms_distance = Room.search_rooms(room)
return render_template("found.html", rooms_distance=rooms_distance)
return render_template("autoform.html", form=form, title="Search Acco.", submit="Search ad")