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
###############################################################################
评论列表
文章目录