justquick / django-activity-stream

Generate generic activity streams from the actions on your site. Users can follow any actors' activities for personalized streams.
http://django-activity-stream.rtfd.io/en/latest/
BSD 3-Clause "New" or "Revised" License
2.36k stars 483 forks source link

How to set a custom JSONField.encoder #489

Closed todorvelichkov closed 3 years ago

todorvelichkov commented 3 years ago

We are updating out app from Django 2.2 + django-activity-stream==0.8.0 to Django 3.2 + django-activity-stream==0.10.0

In version 0.8.0 django-activity-stream used to work with jsonfield_compat where JSONFIELD_ENCODER_CLASS can be used as a setting in order to set a custom JSONField.encoder. No such options exists anymore for Django's JSONField.

auvipy commented 3 years ago

that was used for compatibility reason which is not needed in newer versions

todorvelichkov commented 3 years ago

I'm sorry @auvipy but I cannot understand you, what do you mean by "not needed"? Is there a way to provide an "encoder" kwarg to JSONField? Our app is storing data in Action.data which cannot be encoded with the default json.JSONEncoder so we definitely need this.

auvipy commented 3 years ago

you can dig codes and find a solution, if that change is needed upstream, contributions are welcome.