예제 #1
0
    def get_by_username_or_email(cls, request, username, email):
        session = get_session(request)

        lhs = func.replace(cls.username, '.', '')
        rhs = username.replace('.', '')
        return session.query(cls).filter(
            or_(func.lower(lhs) == rhs.lower(), cls.email == email)).first()
예제 #2
0
    def get_by_username(cls, request, username):
        session = get_session(request)

        lhs = func.replace(cls.username, '.', '')
        rhs = username.replace('.', '')
        return session.query(cls).filter(
            func.lower(lhs) == rhs.lower()).first()
예제 #3
0
파일: models.py 프로젝트: almereyda/h
    def get_by_username(cls, request, username):
        session = get_session(request)

        lhs = func.replace(cls.username, '.', '')
        rhs = username.replace('.', '')
        return session.query(cls).filter(
            func.lower(lhs) == rhs.lower()
        ).first()
예제 #4
0
파일: notifier.py 프로젝트: ercchy/h
def create_default_subscription(request, user):
    session = get_session(request)
    url_struct = urlparse(request.application_url)
    domain = url_struct.hostname or url_struct.path
    create_system_reply_query(user, domain, session)

    # Added all subscriptions, write it to DB
    user.subscriptions = True
    session.add(user)
    session.flush()
예제 #5
0
def create_default_subscription(request, user):
    session = get_session(request)
    url_struct = urlparse(request.application_url)
    domain = url_struct.hostname or url_struct.path
    create_system_reply_query(user, domain, session)

    # Added all subscriptions, write it to DB
    user.subscriptions = True
    session.add(user)
    session.flush()
예제 #6
0
파일: models.py 프로젝트: almereyda/h
    def get_by_username_or_email(cls, request, username, email):
        session = get_session(request)

        lhs = func.replace(cls.username, '.', '')
        rhs = username.replace('.', '')
        return session.query(cls).filter(
            or_(
                func.lower(lhs) == rhs.lower(),
                cls.email == email
            )
        ).first()