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


Python User.checkIfUesr方法代码示例

本文整理汇总了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
开发者ID:babaniassaf,项目名称:ShareLink,代码行数:28,代码来源:contactspage.py

示例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
开发者ID:babaniassaf,项目名称:ShareLink,代码行数:20,代码来源:add_memebr.py

示例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
开发者ID:babaniassaf,项目名称:ShareLink,代码行数:20,代码来源:mysavedlinks.py

示例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
开发者ID:babaniassaf,项目名称:ShareLink,代码行数:24,代码来源:create_group.py


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