本文整理汇总了Python中app.models.Event.convention方法的典型用法代码示例。如果您正苦于以下问题:Python Event.convention方法的具体用法?Python Event.convention怎么用?Python Event.convention使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.models.Event
的用法示例。
在下文中一共展示了Event.convention方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Event
# 需要导入模块: from app.models import Event [as 别名]
# 或者: from app.models.Event import convention [as 别名]
# Skip the header line.
first_row = False
continue
if row[2] in tuxtrax_tracks:
track_name = tuxtrax_tracks[row[2]]
else:
# There is no corresponding track in CREM at this time.
continue
event = Event()
event.title = row[0]
event.description = unicode(row[1], 'utf8')
event.track = db.session.query(Track).\
filter(Track.name == track_name).first()
event.duration = int(row[3])
event.failityRequest = row[4]
event.convention = convention
# Assign a random timeslot.
timeslot_index = random.randint(0, timeslot_count-1)
timeslot = Timeslot.query.filter_by(timeslot_index=timeslot_index).first()
event.timeslots.append(timeslot)
db.session.add(event)
events_file.close()
# Commit the test data to the database.
db.session.commit()
# Add presenters.
# For each presenter, their first name, last name, email address and