我想在用户的帖子需要批准/拒绝时向其发送电子邮件。
class Post(models.Model):
POST_STATUS = (
('approve', 'approve'),
('pending', 'pending'),
('reject', 'reject')
)
user = models.ForeignKey(User, on_delete=models.CASCADE)
category = models.ForeignKey(Category, on_delete=models.CASCADE)
status = models.CharField(max_length=10, choices=POST_STATUS, default='pending')
#title, body, image will be here