Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translated JSONField now always returns str #701

Closed
jose-reveni opened this issue Sep 8, 2023 · 5 comments
Closed

Translated JSONField now always returns str #701

jose-reveni opened this issue Sep 8, 2023 · 5 comments
Labels

Comments

@jose-reveni
Copy link

With the latest release which includes #700, JSONFields now always returns a str (instead of something like a list or dict).

I'd expect django.utils.encoding.force_strforce_str with strings_only=True to keep types like dicts and lists, but they are not included in the list of protected types.

@last-partizan
Copy link
Collaborator

Hi, please, be more specific and provide code samples.

It returns str when accessing field? Are you using default= argument?

@last-partizan
Copy link
Collaborator

@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.

@last-partizan last-partizan pinned this issue Sep 8, 2023
last-partizan added a commit that referenced this issue Sep 8, 2023
@last-partizan
Copy link
Collaborator

@jose-reveni please, check if the issue is fixed in master branch.

@sergei-maertens
Copy link
Contributor

Check, at least we had quick feedback on this!

@jose-reveni
Copy link
Author

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!

@last-partizan last-partizan unpinned this issue Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants