本文整理汇总了Python中subscription.models.Subscription.add_webhook_task方法的典型用法代码示例。如果您正苦于以下问题:Python Subscription.add_webhook_task方法的具体用法?Python Subscription.add_webhook_task怎么用?Python Subscription.add_webhook_task使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subscription.models.Subscription
的用法示例。
在下文中一共展示了Subscription.add_webhook_task方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: webhook_task
# 需要导入模块: from subscription.models import Subscription [as 别名]
# 或者: from subscription.models.Subscription import add_webhook_task [as 别名]
def webhook_task(request):
"""BadFilterError: invalid filter: Only one property per query may have inequality filters (<=, >=, <, >).."""
subscriptions = Subscription.all().filter("webhook !=", None)
counter = 0
for obj in subscriptions:
Subscription.add_webhook_task(obj.key())
counter += 1
return HttpResponse("Done: added %d" % counter)
示例2: test_webhook
# 需要导入模块: from subscription.models import Subscription [as 别名]
# 或者: from subscription.models.Subscription import add_webhook_task [as 别名]
def test_webhook(request, subkey):
subscription = Subscription.all().filter("subkey =", subkey).get()
if subscription is None or subscription.webhook is None:
raise Http404
Subscription.add_webhook_task(subscription.key())
return HttpResponse("Task for posting to %s added. Will run in some seconds. Be reminded of The Rules on http://www.seriesly.com/webhook-xml/#the-rules" % subscription.webhook)