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

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)
Auto assigns coercing listener for all class properties which are of coerce
capable type.

        def coercion_listener(mapper, class_):
    """
    Auto assigns coercing listener for all class properties which are of coerce
    capable type.
    """
    for prop in mapper.iterate_properties:
        try:
            listener = prop.columns[0].type.coercion_listener
        except AttributeError:
            continue
        sa.event.listen(
            getattr(class_, prop.key),
            'set',
            listener,
            retval=True
        )
        


src/s/q/SQLAlchemy-Utils-0.25.4/sqlalchemy_utils/__init__.py   SQLAlchemy-Utils(Download)
    table_name,
)
from .listeners import (
    coercion_listener,
    force_auto_coercion,

src/s/q/sqlalchemy-utils-HEAD/sqlalchemy_utils/__init__.py   sqlalchemy-utils(Download)
    table_name,
)
from .listeners import (
    coercion_listener,
    force_auto_coercion,