當前位置: 首頁>>代碼示例>>Python>>正文


Python mapper.isa方法代碼示例

本文整理匯總了Python中sqlalchemy.orm.mapper.isa方法的典型用法代碼示例。如果您正苦於以下問題:Python mapper.isa方法的具體用法?Python mapper.isa怎麽用?Python mapper.isa使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sqlalchemy.orm.mapper的用法示例。


在下文中一共展示了mapper.isa方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _include_fn

# 需要導入模塊: from sqlalchemy.orm import mapper [as 別名]
# 或者: from sqlalchemy.orm.mapper import isa [as 別名]
def _include_fn(self, elem):
        entity = elem._annotations.get('parentmapper', None)
        return not entity or entity.isa(self.mapper) 
開發者ID:jpush,項目名稱:jbox,代碼行數:5,代碼來源:util.py

示例2: _entity_for_mapper

# 需要導入模塊: from sqlalchemy.orm import mapper [as 別名]
# 或者: from sqlalchemy.orm.mapper import isa [as 別名]
def _entity_for_mapper(self, mapper):
        self_poly = self.with_polymorphic_mappers
        if mapper in self_poly:
            if mapper is self.mapper:
                return self
            else:
                return getattr(
                    self.entity, mapper.class_.__name__)._aliased_insp
        elif mapper.isa(self.mapper):
            return self
        else:
            assert False, "mapper %s doesn't correspond to %s" % (
                mapper, self) 
開發者ID:jpush,項目名稱:jbox,代碼行數:15,代碼來源:util.py

示例3: _entity_isa

# 需要導入模塊: from sqlalchemy.orm import mapper [as 別名]
# 或者: from sqlalchemy.orm.mapper import isa [as 別名]
def _entity_isa(given, mapper):
    """determine if 'given' "is a" mapper, in terms of the given
    would load rows of type 'mapper'.

    """
    if given.is_aliased_class:
        return mapper in given.with_polymorphic_mappers or \
            given.mapper.isa(mapper)
    elif given.with_polymorphic_mappers:
        return mapper in given.with_polymorphic_mappers
    else:
        return given.isa(mapper) 
開發者ID:yfauser,項目名稱:planespotter,代碼行數:14,代碼來源:util.py

示例4: replace

# 需要導入模塊: from sqlalchemy.orm import mapper [as 別名]
# 或者: from sqlalchemy.orm.mapper import isa [as 別名]
def replace(self, elem):
        entity = elem._annotations.get('parentmapper', None)
        if not entity or entity.isa(self.mapper):
            return sql_util.ColumnAdapter.replace(self, elem)
        else:
            return None 
開發者ID:gltn,項目名稱:stdm,代碼行數:8,代碼來源:util.py

示例5: _entity_for_mapper

# 需要導入模塊: from sqlalchemy.orm import mapper [as 別名]
# 或者: from sqlalchemy.orm.mapper import isa [as 別名]
def _entity_for_mapper(self, mapper):
        self_poly = self.with_polymorphic_mappers
        if mapper in self_poly:
            return getattr(self.entity, mapper.class_.__name__)._aliased_insp
        elif mapper.isa(self.mapper):
            return self
        else:
            assert False, "mapper %s doesn't correspond to %s" % (
                mapper, self) 
開發者ID:gltn,項目名稱:stdm,代碼行數:11,代碼來源:util.py

示例6: _include_fn

# 需要導入模塊: from sqlalchemy.orm import mapper [as 別名]
# 或者: from sqlalchemy.orm.mapper import isa [as 別名]
def _include_fn(self, elem):
        entity = elem._annotations.get("parentmapper", None)
        return not entity or entity.isa(self.mapper) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:5,代碼來源:util.py

示例7: _entity_for_mapper

# 需要導入模塊: from sqlalchemy.orm import mapper [as 別名]
# 或者: from sqlalchemy.orm.mapper import isa [as 別名]
def _entity_for_mapper(self, mapper):
        self_poly = self.with_polymorphic_mappers
        if mapper in self_poly:
            if mapper is self.mapper:
                return self
            else:
                return getattr(
                    self.entity, mapper.class_.__name__
                )._aliased_insp
        elif mapper.isa(self.mapper):
            return self
        else:
            assert False, "mapper %s doesn't correspond to %s" % (mapper, self) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:15,代碼來源:util.py

示例8: _entity_isa

# 需要導入模塊: from sqlalchemy.orm import mapper [as 別名]
# 或者: from sqlalchemy.orm.mapper import isa [as 別名]
def _entity_isa(given, mapper):
    """determine if 'given' "is a" mapper, in terms of the given
    would load rows of type 'mapper'.

    """
    if given.is_aliased_class:
        return mapper in given.with_polymorphic_mappers or given.mapper.isa(
            mapper
        )
    elif given.with_polymorphic_mappers:
        return mapper in given.with_polymorphic_mappers
    else:
        return given.isa(mapper) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:15,代碼來源:util.py

示例9: _entity_for_mapper

# 需要導入模塊: from sqlalchemy.orm import mapper [as 別名]
# 或者: from sqlalchemy.orm.mapper import isa [as 別名]
def _entity_for_mapper(self, mapper):
        self_poly = self.with_polymorphic_mappers
        if mapper in self_poly:
            return getattr(self.entity, mapper.class_.__name__)._aliased_insp
        elif mapper.isa(self.mapper):
            return self
        else:
            assert False, "mapper %s doesn't correspond to %s" % (mapper, self) 
開發者ID:binhex,項目名稱:moviegrabber,代碼行數:10,代碼來源:util.py


注:本文中的sqlalchemy.orm.mapper.isa方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。