本文整理汇总了Python中Event.cb_fill方法的典型用法代码示例。如果您正苦于以下问题:Python Event.cb_fill方法的具体用法?Python Event.cb_fill怎么用?Python Event.cb_fill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Event
的用法示例。
在下文中一共展示了Event.cb_fill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fill_insert
# 需要导入模块: import Event [as 别名]
# 或者: from Event import cb_fill [as 别名]
def fill_insert(classe, i):
classe.name = "C"+str(i)
classe.planning = Planning()
# XXX fill planning with normal events ?
#classe.planning.cb_fill(number)
# XXX fill planning with course events
cursus = db.session.query(Cursus).get(i+1)
if cursus:
periods = cursus.periods
import Event
Event.fill_date = cursus.start
else:
periods = []
for period in periods:
for course in period.courses:
from Event import Event
# XXX move fill event in class
event = Event()
event.planning = classe.planning
event.course = course
course.c_elearning_rest = course.c_elearning
course.c_classroom_rest = course.c_classroom
course.c_practice_rest = course.c_practice
course.e_oral_rest = course.e_oral
course.e_practice_rest = course.e_practice
hours = course.c_elearning
hours += course.c_classroom
hours += course.c_practice
hours += course.e_oral
hours += course.e_practice
event.cb_fill(hours / 2)
if len(period.classes) == 0:
for course in period.courses:
event = Event()
event.planning = period.planning
event.course = course
event.cb_fill(event.course.e_exam / 2 + 1)
import Event
Event.fill_date = period.end
classe.periods = periods
user = User()
user.manager_class = [classe]
user.cb_fill(randint(1, number),
classe.campus.name + '_' + classe.name +
'_manager_user' + str(i))
user = User()
user.student_class = classe
user.cb_fill(randint(10, 30), classe.campus.name+'_'+classe.name+'_student_user'+str(i))
db.session.add(classe)