将自定义字段添加到django-notifications时始终在notify.send

问题描述

我正在尝试向django-notifications-hq中的Notification模型添加一个新字段。目前在我的main/models.py中,我有:

class Notification(AbstractNotification):
    # custom field example
    unique_uuid = models.CharField(max_length=255,unique=True,null=True)

    class Meta(AbstractNotification.Meta):
        abstract = False
        app_label = 'main'

现在我的settings.py文件中有:

NOTIFICATIONS_NOTIFICATION_MODEL = 'main.Notification'
NOTIFICATIONS_USE_JSONFIELD=True

我正在尝试通过以下方式在我的views.py中生成通知:

notify.send(sender=user,recipient=post.author,verb=message,target=post,\
                        unique_uuid = notification_create_uuid(...))

但是,通知创建不正确,并且该字段返回“无”。如何在notify.send()中设置此字段,以便使用该字段集创建通知?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)