django-modeltranslation icon indicating copy to clipboard operation
django-modeltranslation copied to clipboard

JSONField not supported even though it's now a core Django field

Open parruc opened this issue 4 years ago • 1 comments

JSONField is an officially supported django field included into django.db.models since Django 3.1 but looks like it does not work well with modeltranslation ATM. I tried adding it to MODELTRANSLATION_CUSTOM_FIELDS as an older issue suggested but it does not seem to work.

In admin area when I try to save the objects I get a: "Please correct the error below."

It's also not included in fields compatibility matrix in the documentation.

parruc avatar Oct 02 '21 08:10 parruc

My bad the field giving error was another, buildtin JSONField seems to work correctly.

I would keep it open to remember to proudly add it to the compatibility matrix. It could also be included in the fields that works out of the box without

parruc avatar Oct 02 '21 08:10 parruc

Hey! could you please share the code, how did you used the JSON field in modelTranslation?

ruchika2012 avatar Jan 19 '23 05:01 ruchika2012

There is no code needed, just add JSONField to the MODELTRANSLATION_CUSTOM_FIELDS in settings.py

parruc avatar Jan 19 '23 07:01 parruc

Thank you so much for responding.

ruchika2012 avatar Jan 20 '23 06:01 ruchika2012