当前位置: 首页>>代码示例>>Python>>正文


Python Activity.pull方法代码示例

本文整理汇总了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)
开发者ID:pchennz,项目名称:KEEN-full,代码行数:13,代码来源:tasks.py

示例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)
开发者ID:pchennz,项目名称:KEEN-full,代码行数:10,代码来源:tasks.py

示例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
开发者ID:pchennz,项目名称:KEEN-full,代码行数:15,代码来源:tasks.py

示例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))
开发者ID:pchennz,项目名称:KEEN-full,代码行数:6,代码来源:tasks.py


注:本文中的models.Activity.pull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。