Adding Custom Data to your ActionsΒΆ

As of v0.4.4, django-activity-stream now supports adding custom data to any Actions you generate. This uses a data JSONField on every Action where you can insert and delete values at will. This behavior is disabled by default but just set ACTSTREAM_SETTINGS['USE_JSONFIELD'] = True in your to enable it.


This feature requires that you have django-jsonfield installed

You can send the custom data as extra keyword arguments to the action signal.

action.send(galahad, verb='answered', target=bridgekeeper,
    favorite_color='Blue. No, yel... AAAAAAA')

Now you can retrieve the data dictionary once you grab the action and manipulate it to your liking at anytime.

>>> action = Action.objects.get(verb='answered', actor=galahad, target=bridgekeeper)
... 'Blue. No, yel... AAAAAAA'
>>>['quest'] = 'To seek the Holy Grail'
... {'favorite_color': 'Blue. No, Green - AAAAAAA', 'quest': 'To seek the Holy Grail'}

Even in a template

You are {{ }} your quest is {{ }} and your favorite color is {{ }}