Ejemplo n.º 1
0
 def get_by_email(cls, email):
     try:
         return DBSession.query(cls).filter(cls.email == email).one()
     except sa.orm.exc.NoResultFound:
         return None
Ejemplo n.º 2
0
 def get_by_username(cls, username):
     try:
         return DBSession.query(cls).filter(cls.username == username).one()
     except sa.orm.exc.NoResultFound:
         return None