Closed jose-reveni closed 1 month ago
Hi, please, be more specific and provide code samples.
It returns str when accessing field? Are you using default= argument?
@sergei-maertens looks like default
with JSONField is broken and we need to refactor it, probably to work only for char fields where translation makes sense.
I yanked the release, to limit affected users.
@jose-reveni please, check if the issue is fixed in master branch.
Check, at least we had quick feedback on this!
Sorry it took me so long to reply, I just remembered I had opened this issue after checking my pyproject.toml
😅
I just checked with v0.18.13-beta.0 and its working perfectly!
With the latest release which includes https://github.com/deschler/django-modeltranslation/pull/700, JSONFields now always returns a str (instead of something like a list or dict).
I'd expect
django.utils.encoding.force_strforce_str
withstrings_only=True
to keep types like dicts and lists, but they are not included in the list of protected types.