4 @link: http://hierarchical-cluster-engine.com/ 5 @copyright: Copyright © 2013-2014 IOIX Ukraine 6 @license: http://hierarchical-cluster-engine.com/license/ 28 super(AttrUpdateTask, self).
__init__()
37 def process(self, attrUpdates, queryCallback):
39 for attrUpdate
in attrUpdates:
41 if self.
isSiteExist(attrUpdate.siteId, queryCallback):
42 if self.
arrtSet.selectAttribute(attrUpdate, queryCallback):
47 localAttribute.urlMd5 = attrUpdate.urlMd5
if attrUpdate.urlMd5
is not None else "" 48 localAttribute.value = attrUpdate.value
if attrUpdate.value
is not None else "" 50 if len(localRet.statuses) > 0
and localRet.statuses[0] == AttrSetTask.CODE_GOOD_INSERT:
52 ret.statuses.append(statusValue)
61 UPDATE_TEMPLATE =
"UPDATE `att_%s` SET `Value` = '%s' WHERE `Name` = '%s' AND `URLMd5` = '%s'" 62 query = UPDATE_TEMPLATE % (attrObject.siteId, Utils.escape(attrObject.value), attrObject.name,
63 attrObject.urlMd5
if attrObject.urlMd5
is not None else "")
64 queryCallback(query, Constants.ATT_DB_ID, Constants.EXEC_NAME,
True)
def isSiteExist(self, siteId, queryCallback, userId=None)
GeneralResponse event object, represents general state response for multipurpose usage.
def process(self, attrUpdates, queryCallback)
def updateAttribute(self, attrObject, queryCallback)