Beispiel #1
0
    def save_user(self, username, password, email):
        passwd = cookie.make_pw_hash(password, SECRET)

        user = models.User(username=username,
                password=passwd,
                email=email)

        ukey = user.put()
        return ukey.id()
Beispiel #2
0
    def get_user(self, name, password):
#        user = models.User.all().filter('username='******'WHERE username=:1', name).fetch(1)[0]
        except IndexError:
            return None

        passwd = cookie.make_pw_hash(password, SECRET, user.password)

        if passwd == user.password:
            return user.key().id()