Ejemplo n.º 1
0
def checkForUser(userID, forceRefresh = False):
	cacheKey = userCacheKey(userID)
	userObject = memcache.get(cacheKey)
	if userObject is None or forceRefresh:
		userObject = appUsers.all().filter('userID = ', userID).get()
		if userObject is not None:
			memcache.set(cacheKey, userObject)
	return userObject
Ejemplo n.º 2
0
def getNicknames(newName = None):
	currentNicknamesList = memcache.get('currentNicknamesList')
	if currentNicknamesList is None:
		currentNicknamesList = []
		allUsers = appUsers.all()
		for user in allUsers:
			currentNicknamesList.append(user.nickname)
		memcache.set('currentNicknamesList', currentNicknamesList)
	return currentNicknamesList
Ejemplo n.º 3
0
def getAllUsers(refresh = False):
	allUsers = memcache.get('allUsers')
	if allUsers is None or refresh:
		allUsers = []
		users = appUsers.all()
		for user in users:
			allUsers.append(user.userID)
		memcache.set('allUsers', allUsers)
	return allUsers