本文整理汇总了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
示例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
示例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))
示例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
示例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
示例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)
示例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)))
示例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)))
示例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)
示例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)
示例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)
示例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
示例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))
示例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
示例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)