本文整理汇总了Python中model.Member.create_or_update方法的典型用法代码示例。如果您正苦于以下问题:Python Member.create_or_update方法的具体用法?Python Member.create_or_update怎么用?Python Member.create_or_update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Member
的用法示例。
在下文中一共展示了Member.create_or_update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import create_or_update [as 别名]
def post(self, email):
if not self.session['member'] == email:
self.response.out.write('access denied')
return
image = self.get_uploads("member-image-upload")
image_key = str(image[0].key()) if image else None
image_coords = [float(coord) for coord in self['image_coords'].split(',')] if self['image_coords'] else None
key = email if email else self['email']
image_url = '/api/members/'+key+'/image' if image_key else None
Member.create_or_update(key, name=self['name'], organization=self["organization"],
designation=self["designation"], image=image_key, website=self["website"],
twitter_handle=self["twitter_handle"], facebook_id=self["facebook_id"], bio=self["bio"],
password=self['password'], image_coords=image_coords, image_url=image_url)
self.redirect("/members/profile")