4 @link: http://hierarchical-cluster-engine.com/ 5 @copyright: Copyright © 2013-2014 IOIX Ukraine 6 @license: http://hierarchical-cluster-engine.com/license/ 26 ATTR_DELETE_TEMPLATE =
"DELETE FROM `%s` " 32 super(AttrDeleteTask, self).
__init__()
40 def process(self, attrDeletes, queryCallback):
42 for attrDelete
in attrDeletes:
43 if self.
isSiteExist(attrDelete.siteId, queryCallback):
46 if attrDelete.name
is None:
49 additionWhere = (
"WHERE `Name` = '%s'" % attrDelete.name)
50 logger.debug(
">>> additionWhere = " + str(additionWhere))
51 if additionWhere
is not None and len(additionWhere) > 0:
52 query = AttrDeleteTask.ATTR_DELETE_TEMPLATE % ((Constants.DC_ATT_TABLE_NAME_TEMPLATE % attrDelete.siteId))
53 queryCallback(query + additionWhere, Constants.ATT_DB_ID)
54 ret.statuses.append(
True)
56 ret.statuses.append(
False)
57 except Exception
as excp:
58 logger.debug(
">>> [AttributeDelete] Some Exception = " + str(
type(excp)) +
" " + str(excp))
59 ret.statuses.append(
False)
61 ret.statuses.append(
False)
74 res = attrDeleteTask.process(attrDeletes, queryCallback)
75 logger.debug(
">>> AttrDeleteTask.deleteUrlsAttributes operation result = " +
varDump(res))
def isSiteExist(self, siteId, queryCallback, userId=None)
GeneralResponse event object, represents general state response for multipurpose usage.
def deleteUrlsAttributes(siteId, urlMd5, queryCallback)
def process(self, attrDeletes, queryCallback)
def generateCriterionSQL(self, criterions, additionWhere=None, siteId=None)
def varDump(obj, stringify=True, strTypeMaxLen=256, strTypeCutSuffix='...', stringifyType=1, ignoreErrors=False, objectsHash=None, depth=0, indent=2, ensure_ascii=False, maxDepth=10)