当前位置: 首页>>代码示例>>Python>>正文


Python Event.cb_fill方法代码示例

本文整理汇总了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)
开发者ID:SBillion,项目名称:timetableasy,代码行数:58,代码来源:Class.py


注:本文中的Event.cb_fill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。