Example #1
0
	def getIdByName(self, name):
		
		''' Method returns user id if user exists or False otherwise '''
		
		searchParams = dict(name=name)
		foundNames = db.select(self.__table, searchParams, where="name = $name")
		if len(foundNames) == 1:
			result = foundNames[0].id
		else:
			result = self.__add(**{'name': name,});
			
		return result