當前位置: 首頁>>代碼示例>>Python>>正文


Python Schedule.day方法代碼示例

本文整理匯總了Python中schedule.Schedule.day方法的典型用法代碼示例。如果您正苦於以下問題:Python Schedule.day方法的具體用法?Python Schedule.day怎麽用?Python Schedule.day使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在schedule.Schedule的用法示例。


在下文中一共展示了Schedule.day方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: post

# 需要導入模塊: from schedule import Schedule [as 別名]
# 或者: from schedule.Schedule import day [as 別名]
	def post(self):
		user = users.get_current_user()

		if user != None:
			user_name = user.nickname()
			access_link = users.create_logout_url('/')

			# Get values from inputs and save into database
			day = self.request.get('day')
			hourStart = int(self.request.get('hourStart'))
			minStart = int(self.request.get('minStart'))
			hourEnd = int(self.request.get('hourEnd'))
			minEnd = int(self.request.get('minEnd'))
			task = self.request.get('task')

			# Store data into database
			schedule = Schedule()

			schedule.user = user.user_id()

			schedule.day = day
			schedule.hourStart = hourStart
			schedule.minStart = minStart
			schedule.hourEnd = hourEnd
			schedule.minEnd = minEnd
			schedule.task = task

			schedule.put()

			time.sleep(1)

			# Get query from database
			monday = Schedule.query(Schedule.user == user.user_id()).filter(Schedule.day == 'lunes')
			tuesday = Schedule.query(Schedule.user == user.user_id()).filter(Schedule.day == 'martes')
			wednesday = Schedule.query(Schedule.user == user.user_id()).filter(Schedule.day == 'miercoles')
			thursday = Schedule.query(Schedule.user == user.user_id()).filter(Schedule.day == 'jueves')
			friday = Schedule.query(Schedule.user == user.user_id()).filter(Schedule.day == 'viernes')
			saturday = Schedule.query(Schedule.user == user.user_id()).filter(Schedule.day == 'sabado')
			sunday = Schedule.query(Schedule.user == user.user_id()).filter(Schedule.day == 'domingo')

			template_values = {
				'user_name' : user_name,
				'access_link' : access_link,
				'monday' : monday,
				'tuesday' : tuesday,
				'wednesday' : wednesday,
				'thursday' : thursday,
				'friday' : friday,
				'saturday' : saturday,
				'sunday' : sunday
			}

			template = JINJA_ENVIRONMENT.get_template('showSchedule.html')
			self.response.write(template.render(template_values));
		else:
			self.redirect('/')
開發者ID:hrosalgado,項目名稱:ALS,代碼行數:58,代碼來源:addFieldSchedule.py


注:本文中的schedule.Schedule.day方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。