本文整理匯總了Python中DIRAC.ResourceStatusSystem.Utilities.MySQLWrapper.update方法的典型用法代碼示例。如果您正苦於以下問題:Python MySQLWrapper.update方法的具體用法?Python MySQLWrapper.update怎麽用?Python MySQLWrapper.update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DIRAC.ResourceStatusSystem.Utilities.MySQLWrapper
的用法示例。
在下文中一共展示了MySQLWrapper.update方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: update
# 需要導入模塊: from DIRAC.ResourceStatusSystem.Utilities import MySQLWrapper [as 別名]
# 或者: from DIRAC.ResourceStatusSystem.Utilities.MySQLWrapper import update [as 別名]
def update( self, params, meta ):
'''
Updates row with values given on args. The row selection is done using the
default of MySQLMonkey ( column.primary or column.keyColumn ). It can be
modified using kwargs. The 'table' keyword argument is mandatory, and
filled automatically by the Client. Typically you will not pass kwargs to
this function, unless you know what are you doing and you have a very
special use case.
:Parameters:
**params** - `dict`
arguments for the mysql query ( must match table columns ! ).
**meta** - `dict`
metadata for the mysql query. It must contain, at least, `table` key
with the proper table name.
:return: S_OK() || S_ERROR()
'''
# We force lastCheckTime to utcnow if it is not present on the params
#if not( 'lastCheckTime' in params and not( params[ 'lastCheckTime' ] is None ) ):
if 'lastCheckTime' in params and params[ 'lastCheckTime' ] is None:
params[ 'lastCheckTime' ] = datetime.utcnow().replace( microsecond = 0 )
return MySQLWrapper.update( self, params, meta )