本文整理汇总了Python中sqlalchemy.orm.mapper._equivalent_columns方法的典型用法代码示例。如果您正苦于以下问题:Python mapper._equivalent_columns方法的具体用法?Python mapper._equivalent_columns怎么用?Python mapper._equivalent_columns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sqlalchemy.orm.mapper
的用法示例。
在下文中一共展示了mapper._equivalent_columns方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sqlalchemy.orm import mapper [as 别名]
# 或者: from sqlalchemy.orm.mapper import _equivalent_columns [as 别名]
def __init__(self, entity, mapper, selectable, name,
with_polymorphic_mappers, polymorphic_on,
_base_alias, _use_mapper_path, adapt_on_names):
self.entity = entity
self.mapper = mapper
self.selectable = selectable
self.name = name
self.with_polymorphic_mappers = with_polymorphic_mappers
self.polymorphic_on = polymorphic_on
self._base_alias = _base_alias or self
self._use_mapper_path = _use_mapper_path
self._adapter = sql_util.ColumnAdapter(
selectable, equivalents=mapper._equivalent_columns,
adapt_on_names=adapt_on_names, anonymize_labels=True)
self._adapt_on_names = adapt_on_names
self._target = mapper.class_
for poly in self.with_polymorphic_mappers:
if poly is not mapper:
setattr(self.entity, poly.class_.__name__,
AliasedClass(poly.class_, selectable, base_alias=self,
adapt_on_names=adapt_on_names,
use_mapper_path=_use_mapper_path))
示例2: __init__
# 需要导入模块: from sqlalchemy.orm import mapper [as 别名]
# 或者: from sqlalchemy.orm.mapper import _equivalent_columns [as 别名]
def __init__(self, entity, mapper, selectable, name,
with_polymorphic_mappers, polymorphic_on,
_base_alias, _use_mapper_path, adapt_on_names):
self.entity = entity
self.mapper = mapper
self.selectable = selectable
self.name = name
self.with_polymorphic_mappers = with_polymorphic_mappers
self.polymorphic_on = polymorphic_on
self._base_alias = _base_alias or self
self._use_mapper_path = _use_mapper_path
self._adapter = sql_util.ClauseAdapter(
selectable, equivalents=mapper._equivalent_columns,
adapt_on_names=adapt_on_names)
self._adapt_on_names = adapt_on_names
self._target = mapper.class_
for poly in self.with_polymorphic_mappers:
if poly is not mapper:
setattr(self.entity, poly.class_.__name__,
AliasedClass(poly.class_, selectable, base_alias=self,
adapt_on_names=adapt_on_names,
use_mapper_path=_use_mapper_path))
示例3: __init__
# 需要导入模块: from sqlalchemy.orm import mapper [as 别名]
# 或者: from sqlalchemy.orm.mapper import _equivalent_columns [as 别名]
def __init__(self, entity, mapper, selectable, name,
with_polymorphic_mappers, polymorphic_on,
_base_alias, _use_mapper_path, adapt_on_names):
self.entity = entity
self.mapper = mapper
self.selectable = selectable
self.name = name
self.with_polymorphic_mappers = with_polymorphic_mappers
self.polymorphic_on = polymorphic_on
self._base_alias = _base_alias or self
self._use_mapper_path = _use_mapper_path
self._adapter = sql_util.ClauseAdapter(selectable,
equivalents=mapper._equivalent_columns,
adapt_on_names=adapt_on_names)
self._adapt_on_names = adapt_on_names
self._target = mapper.class_
for poly in self.with_polymorphic_mappers:
if poly is not mapper:
setattr(self.entity, poly.class_.__name__,
AliasedClass(poly.class_, selectable, base_alias=self,
adapt_on_names=adapt_on_names,
use_mapper_path=_use_mapper_path))
示例4: __init__
# 需要导入模块: from sqlalchemy.orm import mapper [as 别名]
# 或者: from sqlalchemy.orm.mapper import _equivalent_columns [as 别名]
def __init__(self, entity, mapper, selectable, name,
with_polymorphic_mappers, polymorphic_on,
_base_alias, _use_mapper_path, adapt_on_names,
represents_outer_join):
self.entity = entity
self.mapper = mapper
self.selectable = selectable
self.name = name
self.with_polymorphic_mappers = with_polymorphic_mappers
self.polymorphic_on = polymorphic_on
self._base_alias = _base_alias or self
self._use_mapper_path = _use_mapper_path
self.represents_outer_join = represents_outer_join
self._adapter = sql_util.ColumnAdapter(
selectable, equivalents=mapper._equivalent_columns,
adapt_on_names=adapt_on_names, anonymize_labels=True)
self._adapt_on_names = adapt_on_names
self._target = mapper.class_
for poly in self.with_polymorphic_mappers:
if poly is not mapper:
setattr(self.entity, poly.class_.__name__,
AliasedClass(poly.class_, selectable, base_alias=self,
adapt_on_names=adapt_on_names,
use_mapper_path=_use_mapper_path))
示例5: __init__
# 需要导入模块: from sqlalchemy.orm import mapper [as 别名]
# 或者: from sqlalchemy.orm.mapper import _equivalent_columns [as 别名]
def __init__(
self,
entity,
inspected,
selectable,
name,
with_polymorphic_mappers,
polymorphic_on,
_base_alias,
_use_mapper_path,
adapt_on_names,
represents_outer_join,
):
mapped_class_or_ac = inspected.entity
mapper = inspected.mapper
self._weak_entity = weakref.ref(entity)
self.mapper = mapper
self.selectable = (
self.persist_selectable
) = self.local_table = selectable
self.name = name
self.polymorphic_on = polymorphic_on
self._base_alias = weakref.ref(_base_alias or self)
self._use_mapper_path = _use_mapper_path
self.represents_outer_join = represents_outer_join
if with_polymorphic_mappers:
self._is_with_polymorphic = True
self.with_polymorphic_mappers = with_polymorphic_mappers
self._with_polymorphic_entities = []
for poly in self.with_polymorphic_mappers:
if poly is not mapper:
ent = AliasedClass(
poly.class_,
selectable,
base_alias=self,
adapt_on_names=adapt_on_names,
use_mapper_path=_use_mapper_path,
)
setattr(self.entity, poly.class_.__name__, ent)
self._with_polymorphic_entities.append(ent._aliased_insp)
else:
self._is_with_polymorphic = False
self.with_polymorphic_mappers = [mapper]
self._adapter = sql_util.ColumnAdapter(
selectable,
equivalents=mapper._equivalent_columns,
adapt_on_names=adapt_on_names,
anonymize_labels=True,
)
if inspected.is_aliased_class:
self._adapter = inspected._adapter.wrap(self._adapter)
self._adapt_on_names = adapt_on_names
self._target = mapped_class_or_ac
# self._target = mapper.class_ # mapped_class_or_ac