我正在尝试设置一些类似于以下内容的 post_save 接收器
@receiver(post_save, sender=Game, dispatch_uid='game_updated')
def game_updated(sender, **kwargs):
'''DO SOME STUFF HERE'''
MyPick.objects.filter(week=game.week, team=game.home_team).update(result=home_result)
MyPick.objects.filter(week=game.week, team=game.away_team).update(result=away_result)
@receiver(post_save, sender=MyPick, dispatch_uid='user_pick_updated')
def update_standings(sender, **kwargs):
'''DO STUFF'''
在更新 Game 对象后,第一个接收器被正确调用,但是对 MyPick 对象的更新调用不会导致调用第二个接收器。post_save 信号在更新时不起作用还是我在这里遗漏了其他东西?
谢谢