當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。