Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Add extra data to Django notifications model object (extend the notify signal)

Extra data
You can attach arbitrary data to your notifications by doing the following:

Add to your settings.py: DJANGO_NOTIFICATIONS_CONFIG = { 'USE_JSONFIELD': True}
Then, any extra arguments you pass to notify.send(...) will be attached to the .data attribute of the notification object. These will be serialised using the JSONField's serialiser, so you may need to take that into account: using only objects that will be serialised is a good idea.
Source by github.com #
 
PREVIOUS NEXT
Tagged: #Add #extra #data #Django #notifications #model #object #notify
ADD COMMENT
Topic
Name
5+5 =