当前位置: 首页>>代码示例>>Python>>正文


Python sqlalchemy_utils.get_mapper函数代码示例

本文整理汇总了Python中sqlalchemy_utils.get_mapper函数的典型用法代码示例。如果您正苦于以下问题:Python get_mapper函数的具体用法?Python get_mapper怎么用?Python get_mapper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_mapper函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_column_of_an_alias

 def test_column_of_an_alias(self):
     assert (
         get_mapper(sa.orm.aliased(self.Building.__table__).c.id) ==
         sa.inspect(self.Building)
     )
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:5,代码来源:test_get_mapper.py

示例2: test_table_alias

 def test_table_alias(self):
     alias = sa.orm.aliased(self.Building.__table__)
     assert (
         get_mapper(alias) ==
         sa.inspect(self.Building)
     )
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:6,代码来源:test_get_mapper.py

示例3: test_column

 def test_column(self):
     assert (
         get_mapper(self.Building.__table__.c.id) ==
         sa.inspect(self.Building)
     )
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:5,代码来源:test_get_mapper.py

示例4: test_class_alias

 def test_class_alias(self):
     assert (
         get_mapper(sa.orm.aliased(self.Building)) ==
         sa.inspect(self.Building)
     )
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:5,代码来源:test_get_mapper.py

示例5: test_instrumented_attribute

 def test_instrumented_attribute(self):
     assert (
         get_mapper(self.Building.id) == sa.inspect(self.Building)
     )
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:4,代码来源:test_get_mapper.py

示例6: test_table

 def test_table(self, Building):
     with pytest.raises(ValueError):
         get_mapper(Building.__table__)
开发者ID:JackWink,项目名称:sqlalchemy-utils,代码行数:3,代码来源:test_get_mapper.py

示例7: test_mapper

 def test_mapper(self):
     assert (
         get_mapper(self.Building.__mapper__) ==
         sa.inspect(self.Building)
     )
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:5,代码来源:test_get_mapper.py

示例8: test_table

 def test_table(self):
     assert get_mapper(self.Building.__table__) == sa.inspect(self.Building)
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:2,代码来源:test_get_mapper.py

示例9: test_mapper_entity_with_mapper

 def test_mapper_entity_with_mapper(self, session, Building):
     entity = session.query(Building.__mapper__)._entities[0]
     assert (
         get_mapper(entity) ==
         sa.inspect(Building)
     )
开发者ID:JackWink,项目名称:sqlalchemy-utils,代码行数:6,代码来源:test_get_mapper.py

示例10: test_declarative_class

 def test_declarative_class(self, Building):
     assert (
         get_mapper(Building) ==
         sa.inspect(Building)
     )
开发者ID:JackWink,项目名称:sqlalchemy-utils,代码行数:5,代码来源:test_get_mapper.py

示例11: test_table_alias

 def test_table_alias(self, building):
     alias = sa.orm.aliased(building)
     with pytest.raises(ValueError):
         get_mapper(alias)
开发者ID:JackWink,项目名称:sqlalchemy-utils,代码行数:4,代码来源:test_get_mapper.py

示例12: test_mapper_entity_with_class

 def test_mapper_entity_with_class(self):
     entity = self.session.query(self.Building)._entities[0]
     assert (
         get_mapper(entity) ==
         sa.inspect(self.Building)
     )
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:6,代码来源:test_get_mapper.py

示例13: test_declarative_object

 def test_declarative_object(self):
     assert (
         get_mapper(self.Building()) ==
         sa.inspect(self.Building)
     )
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:5,代码来源:test_get_mapper.py

示例14: test_column_entity

 def test_column_entity(self):
     query = self.session.query(self.Building.id)
     assert get_mapper(query._entities[0]) == sa.inspect(self.Building)
开发者ID:lnielsen,项目名称:sqlalchemy-utils,代码行数:3,代码来源:test_get_mapper.py

示例15: test_declarative_class

 def test_declarative_class(self):
     assert get_mapper(self.Building) == sa.inspect(self.Building)
开发者ID:jd,项目名称:sqlalchemy-utils,代码行数:2,代码来源:test_get_mapper.py


注:本文中的sqlalchemy_utils.get_mapper函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。