本文整理汇总了Python中mozillians.users.tasks.unindex_objects.delay函数的典型用法代码示例。如果您正苦于以下问题:Python delay函数的具体用法?Python delay怎么用?Python delay使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delay函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_search_index
def update_search_index(sender, instance, **kwargs):
if instance.is_complete:
index_objects.delay(sender, [instance.id], public_index=False)
if instance.is_public_indexable:
index_objects.delay(sender, [instance.id], public_index=True)
else:
unindex_objects.delay(UserProfile, [instance.id], public_index=True)
示例2: delete
def delete(request):
user = request.user
unindex_objects.delay(UserProfile, [user.userprofile.id], public_index=False)
unindex_objects.delay(UserProfile, [user.userprofile.id], public_index=True)
remove_from_basket_task.delay(user.email, user.userprofile.basket_token)
user.userprofile.anonymize()
log.info('Deleting %d' % user.id)
auth.logout(request)
return redirect('phonebook:home')
示例3: remove_from_search_index
def remove_from_search_index(sender, instance, **kwargs):
unindex_objects.delay(UserProfile, [instance.id], public_index=False)
unindex_objects.delay(UserProfile, [instance.id], public_index=True)