Exemplo n.º 1
0
def valid_login(email, password):
    password = hashlib.md5(password).hexdigest()
    try:
        user = Session.query(User).filter(User.email==email).\
                filter(User.password==password).one()
    except:
        user = False
    return user
Exemplo n.º 2
0
 def by_user_id(cls, user_id):
     try:
         profile = Session.query(cls).filter(cls.user_id==user_id).one()
     except orm.exc.NoResultFound:
         profile = False
     return profile
Exemplo n.º 3
0
 def by_name(cls,username):
     try:
         user = Session.query(cls).filter(cls.username==username).one()
     except orm.exc.NoResultFound:
         return False
     return user
Exemplo n.º 4
0
 def by_id(cls,user_id):
     try:
         user = Session.query(cls).filter(cls.id==user_id).one()
     except orm.exc.NoResultFound:
         return False
     return user
Exemplo n.º 5
0
 def by_name(cls, name):
     try:
         school = Session.query(cls).filter(cls.name==name).one()
     except orm.exc.NoResultFound:
         school = False
     return school