Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
<comment-ja>
????????????????????
@param session: Session
@type session: sqlalchemy.orm.session.Session
@param email: e-mail
@type email: str
@param password: ?????
@type password: str
@return: karesansui.db.model.user.User
</comment-ja>(more...)

        def login(session, email, password):
    """
    ????????????????????
    @param session: Session
    @type session: sqlalchemy.orm.session.Session
    @param email: e-mail
    @type email: str
    @param password: ?????
    @type password: str
    @return: karesansui.db.model.user.User
    
    
    TODO: English Comment
    
    """
    if email and password:
        _r = session.query(User).filter(User.email == email).first()
        if _r is None:
            return None

        if sha1compare(_r.password, password, _r.salt) is True:
            return _r
        else:
            return None
    return None
        


src/k/a/karesansui-HEAD/karesansui/lib/rest.py   karesansui(Download)
import karesansui
from karesansui.lib.utils import is_int, is_param, karesansui_database_exists
from karesansui.db.access.user import login as dba_login
from karesansui.db.access.machine import is_findbyhost1, is_findbyguest1
from karesansui.lib.const import LOGOUT_FILE_PREFIX, DEFAULT_LANGS
        email, password = b64decode(_http_auth[6:].strip()).split(':')
        session = web.ctx.orm
        user = dba_login(session, unicode(email), unicode(password))
        return (user, email)