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


Python DbAccess.formatSqlValue方法代码示例

本文整理汇总了Python中hgu.db.DbAccess.formatSqlValue方法的典型用法代码示例。如果您正苦于以下问题:Python DbAccess.formatSqlValue方法的具体用法?Python DbAccess.formatSqlValue怎么用?Python DbAccess.formatSqlValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hgu.db.DbAccess的用法示例。


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

示例1: getByAncestorOid

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def getByAncestorOid(ancestorOid, relType = Relationships.PART_OF):
    """
    Return the all records with given OID as ancestor.
    """

    if relType != Relationships.PART_OF:
        # Take this error check out if and when we support transitive
        # closure of other relationship types.
        Util.fatalError([
            "AnadRelationshipTransitive.getByAncestorOid() currently only",
            "works with " + Relationships.PART_OF + " relationships."])

    ancestorIter = Iterator(
        where = (
            ANCESTOR_OID_COLUMN + " = " +
            DbAccess.formatSqlValue(ancestorOid) +
            " and " +
            RELATIONSHIP_TYPE_NAME_COLUMN + " = " +
            DbAccess.formatSqlValue(relType)))

    rels = []

    for dbRec in ancestorIter:
        rels.append(dbRec)

    return rels
开发者ID:ma-tech,项目名称:Anatomy,代码行数:28,代码来源:AnadRelationshipTransitiveDb.py

示例2: getByInstituteType

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def getByInstituteType(instituteName, urlType):
    """
    Return ref url record for institute with type.
    """
    where = (
        "    " + INSTITUTE_COLUMN + " = " +
        DbAccess.formatSqlValue(instituteName) + " " +
        "and " + TYPE_COLUMN + " = " + DbAccess.formatSqlValue(urlType))

    dbRecord = DbAccess.selectOne(_table, where = where)
    if dbRecord:
        return RefUrlDbRecord(dbRecord)
    else:
        return None
开发者ID:ma-tech,项目名称:Anatomy,代码行数:16,代码来源:RefUrlDb.py

示例3: getByRelationShipFkAndProject

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def getByRelationShipFkAndProject(relfk, project):
    """
    Returns the Relationship Project row with the given 
     Relationship Id and Project, 
     or None, if row does not exist.
      Throws exception if more than one record exists.
    """

    sqlRelFk = DbAccess.formatSqlValue(relfk)
    sqlProjectFk = DbAccess.formatSqlValue(project)
    
    return AnaRelationshipProjectDbRecord(DbAccess.selectOne(_table, 
        RELATIONSHIP_FK_COLUMN + " = " + sqlRelFk + " AND " + 
        PROJECT_COLUMN + " = " + sqlProjectFk))
开发者ID:ma-tech,项目名称:Anatomy,代码行数:16,代码来源:AnaRelationshipProjectDb.py

示例4: getByNodeStage

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def getByNodeStage(nodeOid, stageOid):
    """
    Return the timed node for given node at the given stage.
    """

    dbRecord = DbAccess.selectOne(
        _table,
        where = (
            NODE_OID_COLUMN  + " = " + DbAccess.formatSqlValue(nodeOid) +
            " and " +
            STAGE_OID_COLUMN + " = " + DbAccess.formatSqlValue(stageOid))
        )
    if dbRecord:
        return AnaTimedNodeDbRecord(dbRecord)
    else:
        return None
开发者ID:ma-tech,项目名称:Anatomy,代码行数:18,代码来源:AnaTimedNodeDb.py

示例5: insert

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
    def insert(self):
        """
        Generate SQL to insert this record into the database.
        """
        # import here to avoid obscure circular import problem
        from hgu.db import DbAccess

        columnNames = None
        columnValues = None

        for name, value in self.__columnValues.items():
            sqlValue = DbAccess.formatSqlValue(value)
            if columnNames:
                columnNames += ", " + name
                columnValues += ", " + sqlValue
            else:
                columnNames = name
                columnValues = sqlValue

        query = """
            insert into """ + self.getTableName() + """
                ( """ + columnNames + """ )
              values
                ( """ + columnValues + """ );"""

        DbAccess.writeSql(query)

        return
开发者ID:ma-tech,项目名称:Anatomy,代码行数:30,代码来源:DbRecord.py

示例6: ComponentNameIterator

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def ComponentNameIterator(componentName):
    """
    Iterate through all nodes with the given name, in no particular order
    """
    where = (
        COMPONENT_NAME_COLUMN + " = " + DbAccess.formatSqlValue(componentName))
    return _table.Iterator(where = where)
开发者ID:ma-tech,项目名称:Anatomy,代码行数:9,代码来源:AnaNodeDb.py

示例7: getByOid

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def getByOid(nodeOid):
    """
    Return the NODE DB record with the given OID.
    """

    return AnaNodeDbRecord(DbAccess.selectOne(
        _table, where = OID_COLUMN + " = " + DbAccess.formatSqlValue(nodeOid)))
开发者ID:ma-tech,项目名称:Anatomy,代码行数:9,代码来源:AnaNodeDb.py

示例8: getByOid

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def getByOid(exprOid):
    """
    Return the ISH_EXPRESSION DB record with the given OID.
    """

    return IshExpressionDbRecord(DbAccess.selectOne(
        _table, where = OID_COLUMN + " = " + DbAccess.formatSqlValue(exprOid)))
开发者ID:ma-tech,项目名称:Anatomy,代码行数:9,代码来源:IshExpressionDb.py

示例9: Iterator

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def Iterator(perspectiveName):
    """
    Iterate through node in perspective records for the given perspective.
    """
    where = (
        PERSPECTIVE_NAME_COLUMN + " = " +
        DbAccess.formatSqlValue(perspectiveName))
    return _table.Iterator(where = where)
开发者ID:ma-tech,项目名称:Anatomy,代码行数:10,代码来源:AnaNodeInPerspectiveDb.py

示例10: ProbeNameIterator

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def ProbeNameIterator(probeName):
    """
    Iterate through all records with the given probe name

    This makes a DB cursor appear as a Python iterator.
    """
    where = PROBE_NAME_COLUMN + " = " + DbAccess.formatSqlValue(probeName)
    return _table.Iterator(where = where)
开发者ID:ma-tech,项目名称:Anatomy,代码行数:10,代码来源:IshProbeDb.py

示例11: GeneSymbolIterator

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def GeneSymbolIterator(geneSymbol):
    """
    Iterate through all records with the given gene symbol

    This makes a DB cursor appear as a Python iterator.
    """
    where = GENE_SYMBOL_COLUMN + " = " + DbAccess.formatSqlValue(geneSymbol)
    return _table.Iterator(where = where)
开发者ID:ma-tech,项目名称:Anatomy,代码行数:10,代码来源:IshProbeDb.py

示例12: __init__

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
    def __init__(self, submissionOid):

        where = (
            SUBMISSION_FK_COLUMN + " = " +
            DbAccess.formatSqlValue(submissionOid))

        self.__tableIter = _table.Iterator(where = where)
        return None
开发者ID:ma-tech,项目名称:Anatomy,代码行数:10,代码来源:IshOriginalImageDb.py

示例13: getByOid

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def getByOid(oid):
    """
    Returns the submission record with the given OID, or None, if
    record does not exit.  Throws exception if more than one record exists.
    """

    sqlOid = DbAccess.formatSqlValue(oid)
    return IshSubmissionDbRecord(DbAccess.selectOne(
        _table, OID_COLUMN + " = " + sqlOid))
开发者ID:ma-tech,项目名称:Anatomy,代码行数:11,代码来源:IshSubmissionDb.py

示例14: getByParent

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def getByParent(parentOid, relType):
    """
    Return the all records with given OID as parent.
    """

    iter = Iterator(
        where = (
            PARENT_OID_COLUMN + " = " + DbAccess.formatSqlValue(parentOid) +
            " and " +
            RELATIONSHIP_TYPE_NAME_COLUMN + " = " +
            DbAccess.formatSqlValue(relType)))

    rels = []

    for dbRec in iter:
        rels.append(dbRec)

    return rels
开发者ID:ma-tech,项目名称:Anatomy,代码行数:20,代码来源:AnaRelationshipDb.py

示例15: ImageOidIterator

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import formatSqlValue [as 别名]
def ImageOidIterator(imageOid):
    """
    Iterate through all image note records for the given OID, ordered by
    note sequence.
    """
    where = IMAGE_OID_COLUMN + " = " + DbAccess.formatSqlValue(imageOid)
    orderBy = SEQ_COLUMN

    return _table.Iterator(where = where, orderBy = orderBy)
开发者ID:ma-tech,项目名称:Anatomy,代码行数:11,代码来源:IshImageNoteDb.py


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