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


Python DbAccess.selectOne方法代码示例

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


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

示例1: getByAccessionId

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

    accessionId: The public ID of the submission, e.g., ERG:123.
    """

    sqlAccessionId = DbAccess.formatSqlValue(accessionId)
    
    if IshSubmissionDbRecord(DbAccess.selectOne(_table, ACCESSION_ID_COLUMN + " = " + sqlAccessionId)) == None:
        print "NONE"
        
    return IshSubmissionDbRecord(DbAccess.selectOne(
        _table, ACCESSION_ID_COLUMN + " = " + sqlAccessionId))
开发者ID:ma-tech,项目名称:Anatomy,代码行数:17,代码来源:IshSubmissionDb.py

示例2: getByOid

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

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

示例3: getByOid

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

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

示例4: getByOid

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import selectOne [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

示例5: getByOid

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import selectOne [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

示例6: getByOid

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

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

示例7: getBySubmissionOid

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

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

示例8: getByOid

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import selectOne [as 别名]
def getByOid(apoOid):
    """
    Return the AND_PART_OF record with the given OID.  Returns None
    if no record with that OID exists.
    """
    where = (
        "where " + OID_COLUMN + " = " + DbAccess.formatSqlValue(apoOid))

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

示例9: getByOid

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import selectOne [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

示例10: getBySubFk

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import selectOne [as 别名]
def getBySubFk(subfk):
    """
    Returns the sample row with the given Sub ID (FK), 
     or None, if row does not exist.
      Throws exception if more than one record exists.
    """

    sqlSubFk = DbAccess.formatSqlValue(subfk)
    return MicSampleDbRecord(DbAccess.selectOne(
        _table, SUB_FK + " = " + sqlSubFk))
开发者ID:ma-tech,项目名称:Anatomy,代码行数:12,代码来源:MicSampleDb.py

示例11: getByFileName

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import selectOne [as 别名]
def getByFileName(fname):
    """
    Returns the sample row with the given File Name,
     or None, if row does not exist.
      Throws exception if more than one record exists.
    """

    sqlFname = DbAccess.formatSqlValue(fname)
    return MicSampleDbRecord(DbAccess.selectOne(
        _table, FILE_NAME_COLUMN + " = " + sqlFname))
开发者ID:ma-tech,项目名称:Anatomy,代码行数:12,代码来源:MicSampleDb.py

示例12: getByOid

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

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

示例13: getByOid

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

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

示例14: getLatestVersion

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import selectOne [as 别名]
def getLatestVersion():
    """
    Return the newest VERSION DB record.
    """

    return AnaVersionDbRecord(
        DbAccess.selectOne(
            _table,
            where = (
                DATE_COLUMN + " = (select max(" + DATE_COLUMN + ") from " +
                TABLE_NAME + ")" ) ) )
开发者ID:ma-tech,项目名称:Anatomy,代码行数:13,代码来源:AnaVersionDb.py

示例15: getByDisplayId

# 需要导入模块: from hgu.db import DbAccess [as 别名]
# 或者: from hgu.db.DbAccess import selectOne [as 别名]
def getByDisplayId(timedDisplayId):
    """
    Return the TIMED NODE DB record with the given display ID.
    """

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


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