Exemplo n.º 1
0
    def isUserExist(self, userid):
        user = UserModel.get_by_id(userid)

        # print user
        if user is not None:
            return True
        else:
            return False
Exemplo n.º 2
0
    def getUserById(self, userid):
        # print "req:"+ userid
        # query = ndb.GqlQuery("SELECT * UserModel WHERE username = mia ")

        # query = UserModel.query(UserModel.username == userid)
        query = UserModel.get_by_id(userid)
        # print query
        # user = query.get()
        # print user
        # users = query.fetch(1)
        # print users
        # results =  [p.to_dict() for p in users]
        return query.to_dict()
Exemplo n.º 3
0
def identity(payload):
    user_id = payload['identity']
    user = User.get_by_id(user_id)
    return user