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


Python Schedule.put方法代码示例

本文整理汇总了Python中schedule.Schedule.put方法的典型用法代码示例。如果您正苦于以下问题:Python Schedule.put方法的具体用法?Python Schedule.put怎么用?Python Schedule.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在schedule.Schedule的用法示例。


在下文中一共展示了Schedule.put方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: post

# 需要导入模块: from schedule import Schedule [as 别名]
# 或者: from schedule.Schedule import put [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.put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。