Example #1
0
def doUserPoint(uname, do, point):
    user = UserPoint.get_by_key_name("u" + uname)
    if not user:
        user = UserPoint(key_name="u" + uname)
    if do == "+":
        user.point += point
    else:
        user.point -= point
    user.put()
Example #2
0
def getorAddUserPoint(uname):
    user = UserPoint.get_by_key_name("u" + uname)
    if not user:
        user = UserPoint(key_name="u" + uname)
        user.put()
    return user