本文整理汇总了Python中models.user.User.checkIfUesr方法的典型用法代码示例。如果您正苦于以下问题:Python User.checkIfUesr方法的具体用法?Python User.checkIfUesr怎么用?Python User.checkIfUesr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.user.User
的用法示例。
在下文中一共展示了User.checkIfUesr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import checkIfUesr [as 别名]
def get(self):
template_params={}
contact_user_email= self.request.get('contact_user_email')
nick_name= self.request.get('nick_name')
user = None
if self.request.cookies.get('our_token'): #the cookie that should contain the access token!
user = User.checkToken(self.request.cookies.get('our_token'))
if not user:
html = template.render("web/templates/index.html", {})
self.response.write(html)
return
userCon= User.checkIfUesr(contact_user_email)
if userCon is None:
return
# contactlist= Contact.getAllContactsPerUser(user)
# for c in contactlist:
# if c..contact_user_email is contact_user_email:
# return
contact=Contact()
contact.contact_user_email=contact_user_email
contact.nick_name=nick_name
contact.user=user.key
contact.put()
self.response.set_cookie('our_token', str(user.key.id()))
self.response.write(json.dumps({'status':'OK'}))
return
示例2: get
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import checkIfUesr [as 别名]
def get(self):
member=self.request.get('member')
user = None
if self.request.cookies.get('our_token'): #the cookie that should contain the access token!
user = User.checkToken(self.request.cookies.get('our_token'))
if not user:
self.error(403)
self.response.write('No user')
self.response.write(html)
return
if (user.email==member):
return
mem=User.checkIfUesr(member)
if mem is None:
return
self.response.set_cookie('our_token', str(user.key.id()))
self.response.write(json.dumps({'status':'OK'}))
return
示例3: get
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import checkIfUesr [as 别名]
def get(self):
description = self.request.get('description')
url_link = self.request.get('url_link')
to_link = self.request.get('to_link')
user = None
if self.request.cookies.get('our_token'): #the cookie that should contain the access token!
user = User.checkToken(self.request.cookies.get('our_token'))
if not user :
html = template.render("web/templates/index.html", {})
self.response.write(html)
return
userTo=User.checkIfUesr(to_link)
if userTo is None:
return
Link.addlinkfronuser(userTo,url_link,description,user)
self.response.set_cookie('our_token', str(user.key.id()))
self.response.write(json.dumps({'status':'OK'}))
return
示例4: get
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import checkIfUesr [as 别名]
def get(self):
template_params={}
group_name=self.request.get('group_name')
members= json.loads(self.request.get('members'))
user = None
if self.request.cookies.get('our_token'): #the cookie that should contain the access token!
user = User.checkToken(self.request.cookies.get('our_token'))
if not user:
self.error(403)
self.response.write('No user')
self.response.write(html)
return
group= Group()
group.group_name=group_name
group.admin= user.key
for newM in members:
usermem= User.checkIfUesr(newM)
group.members.append(usermem.key)
group.put()
self.response.set_cookie('our_token', str(user.key.id()))
self.response.write(json.dumps({'status':'OK'}))
return