def my_callback(sender, **kwargs): """ 评论通知 :param sender: :param kwargs: :return: """ message = UserMessage() message.user=kwargs['instance'].forums.authors message.ids = kwargs['instance'].forums.id message.to_user_id = kwargs['instance'].user_id message.has_read = False message.url =kwargs['instance'].url message.message="你的%s帖子被人评论了,快去看看吧!"%kwargs['instance'].forums.title message.save()
def my_callback_reply(sender, **kwargs): """ 评论通知 :param sender: :param kwargs: :return: """ message = UserMessage() message.user = kwargs['instance'].to_uids message.ids = kwargs['instance'].aomments_id.article.id message.to_user = kwargs['instance'].user message.has_read = False message.url =kwargs['instance'].url message.message = "你参与的 %s 文章评论有人回复了,快去看看吧!"%kwargs['instance'].aomments_id.article.title message.save()
def my_callback_reply(sender, **kwargs): """ 评论通知 :param sender: :param kwargs: :return: """ message = UserMessage() message.user=kwargs['instance'].to_Parent_Comments message.ids = kwargs['instance'].forums.id message.to_user_id = kwargs['instance'].user_id message.has_read = False message.url =kwargs['instance'].url message.message="你参与的%s帖子评论有人回复了,快去看看吧!"%kwargs['instance'].forums.title message.save()