mutable.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:pyetje 作者: rorlika 项目源码 文件源码
def _setup_composite_listener():
    import types
    def _listen_for_type(mapper, class_):
        for prop in mapper.iterate_properties:
            if (hasattr(prop, 'composite_class') and (type(prop.composite_class) in (types.ClassType, types.TypeType)) and
                issubclass(prop.composite_class, MutableComposite)):
                prop.composite_class._listen_on_attribute(
                    getattr(class_, prop.key), False, class_)
    if not Mapper.dispatch.mapper_configured._contains(Mapper, _listen_for_type):
        event.listen(Mapper, 'mapper_configured', _listen_for_type)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号