dal.py 文件源码

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

项目:StuffShare 作者: StuffShare 项目源码 文件源码
def __call__(cls, *args, **kwargs):
        entity_quoting = kwargs.get('entity_quoting', False)
        if 'entity_quoting' in kwargs:
             del kwargs['entity_quoting']

        obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
        if not entity_quoting:
            quot = obj.QUOTE_TEMPLATE = '%s'
            regex_ent = r'(\w+)'
        else:
            quot = obj.QUOTE_TEMPLATE
            regex_ent = REGEX_NO_GREEDY_ENTITY_NAME
        obj.REGEX_TABLE_DOT_FIELD = re.compile(r'^' + \
                                                    quot % regex_ent + \
                                                    r'\.' + \
                                                    quot % regex_ent + \
                                                    r'$')

        return obj


###############################################################################
# this is a generic adapter that does nothing; all others are derived from this
###############################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号