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


Python Conference.get方法代码示例

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


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

示例1: post

# 需要导入模块: from models import Conference [as 别名]
# 或者: from models.Conference import get [as 别名]
    def post(self, id = None):
	request = self.wsgi_request
	response = self.wsgi_response
	c = self.context

	param_dict = dict(
		title = request.params.title,
		conf_id = request.params.conf_id,
		desc = request.params.desc,
		venue = request.params.venue,
		talk_type = request.params.talk_type,
		start_date = parse(request.params.start_date),
		end_date = parse(request.params.end_date),
		duration = request.params.duration,
		speaker_title = request.params.speaker_title)
	content = param_dict
	session = Session(**param_dict)
	session = session.save()

	conf = Conference.get(session.conf_id)
	if conf:
	    conf.add_session(session)

	self.set_body(session.to_json())
	response.headers['content-type'] = 'application/json'
	return self.render()
开发者ID:droot,项目名称:Batty,代码行数:28,代码来源:handlers.py

示例2: get

# 需要导入模块: from models import Conference [as 别名]
# 或者: from models.Conference import get [as 别名]
    def get(self, conf_handle = None):
	request = self.wsgi_request
	response = self.wsgi_response
	c = self.context

	if conf_handle:
	    conf_id = Conference.get_id_from_url_title(conf_handle)
	    c.conf = Conference.get(conf_id)
	    if c.conf:
		return self.render_stuff('/index.html')	
	
	self.set_body("Please enter a valid conference handle..")
	return self.render()
开发者ID:droot,项目名称:Batty,代码行数:15,代码来源:handlers.py

示例3: delete

# 需要导入模块: from models import Conference [as 别名]
# 或者: from models.Conference import get [as 别名]
    def delete(self, id = None):
	request = self.wsgi_request
	response = self.wsgi_response
	c = self.context
	if id is None:
	    self.set_body('Conf id is a Must')
	else:
	    conf = Conference.get(id)
	    if conf is None:
		self.set_body('No conference with %d exist' % (id))
	    else:
		conf.delete()
		self.set_body("Deleted Successfully...")
	return self.render()
开发者ID:droot,项目名称:Batty,代码行数:16,代码来源:handlers.py

示例4: put

# 需要导入模块: from models import Conference [as 别名]
# 或者: from models.Conference import get [as 别名]
    def put(self, id = None):
	request = self.wsgi_request
	response = self.wsgi_response
	c = self.context

	if id is None:
	    self.set_body('Conf id is a Must')
	else:
	    conf = Conference.get(id)
	    if request.params.title: conf.title = request.params.title
	    if request.params.url_title: conf.url_title = request.params.url_title
	    if request.params.desc: conf.desc = request.params.desc
	    if request.params.venue: conf.venue = request.params.venue
	    if request.params.start_date: conf.start_date = parse(request.params.start_date)
	    if request.params.end_date: conf.end_date = parse(request.params.end_date)
	    if request.params.twitter_handle: conf.twitter_handle = request.params.twitter_handle
	    if request.params.twitter_hashcode: conf.twitter_hashcode = request.params.twitter_hashcode
	    conf = conf.save()
	    conf.update_url_key()
	    self.set_body(conf.to_json())
	return self.render()
开发者ID:droot,项目名称:Batty,代码行数:23,代码来源:handlers.py


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