Django - Signals
How do you properly register a
pre_save signal handler for a Django model called Book using the @receiver decorator?pre_save signal handler for a Django model called Book using the @receiver decorator?@receiver decorator takes the signal and sender as arguments.pre_save on Book, use @receiver(pre_save, sender=Book).pre_save.connect(handler, sender=Book) inside the model class is a method call, not decorator usage; C is invalid syntax; D uses the wrong signal.@receiver(pre_save, sender=Book) above the handler function -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions