本文整理汇总了Python中models.Activity.pull方法的典型用法代码示例。如果您正苦于以下问题:Python Activity.pull方法的具体用法?Python Activity.pull怎么用?Python Activity.pull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Activity
的用法示例。
在下文中一共展示了Activity.pull方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_visibility
# 需要导入模块: from models import Activity [as 别名]
# 或者: from models.Activity import pull [as 别名]
def update_visibility(aid):
"""
Pulls the existing activity and then pushes it again
"""
logger.warning('update_visibility aid:%s' % aid)
logger.warning('update_visibility aid:%s pulling' % aid)
Activity.pull(aid, confirmed = False)
logger.warning('update_visibility aid:%s pushing' % aid)
push_activity(aid)
logger.warning('update_visibility aid:%s pushed' % aid)
示例2: pull_confirmed_activity_later
# 需要导入模块: from models import Activity [as 别名]
# 或者: from models.Activity import pull [as 别名]
def pull_confirmed_activity_later(aid):
"""
Pulls the activity from confirmed users
Will be called by task eta to be activity when + CONFIRMED_USER_PULL_HOURS
"""
success = Activity.pull(aid, confirmed = True)
worked = 'successfully' if success else 'not successfully'
return "pull_confirmed_activity_later on %s %s" % (str(aid), worked)
示例3: pull_default
# 需要导入模块: from models import Activity [as 别名]
# 或者: from models.Activity import pull [as 别名]
def pull_default(aid):
"""
Default task called after DEFAULT_USER_PULL_HOURS
Pulls activity from non confirmed users unless it's confirmed
"""
# activity = Activity.objects.get(id = aid)
success = Activity.pull(aid)
logger.warning('pull_default aid:%s removed from cardstores' % aid)
# if not activity.is_confirmed():
# success = Activity.pull(aid, confirmed = True)
# return "Default pull_non_confirmed on %s not applied, as will be pulled by a later task" % str(aid)
# worked = 'successfully' if success else 'not successfully'
return True
示例4: pull_all
# 需要导入模块: from models import Activity [as 别名]
# 或者: from models.Activity import pull [as 别名]
def pull_all(aid):
success_1 = Activity.pull(aid, confirmed = False)
success_2 = Activity.pull(aid, confirmed = True)
return "%s %s %s" % (str(aid), str(success_1), str(success_2))