Cant get post_save to work in Django

前端 未结 2 1861
北海茫月
北海茫月 2021-01-15 07:51

I read the django docs about signals and wrote this piece of code for my model Car :

@receiver(request_finished)
def s         


        
2条回答
  •  礼貌的吻别
    2021-01-15 08:29

    You binded request_finished signal to signal_callback. Remove(or comment out) signal_callback, and change signal_handler as follow.

    @receiver(post_save, sender=Car)
    def signal_handler(sender, **kwargs):
        print 'Save signal received'
    

提交回复
热议问题