-
Notifications
You must be signed in to change notification settings - Fork 257
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
Feature: support language-specific field defaults #700
Feature: support language-specific field defaults #700
Conversation
dd6f8f2
to
41d7db6
Compare
41d7db6
to
5f94bd8
Compare
5f94bd8
to
89a5c67
Compare
Migration fixes applied here too |
Merged migration fixes, now please rebase this branch or merge master into it to resolve conflicts. |
Sure, I'll be in the office in 30 mins and you can expect the rebase then |
…#698) The expectation is that for every language/translation field, its language gets activated before evaluating the default callable.
89a5c67
to
836daa0
Compare
@last-partizan I've rebased and rewritten the commit messages to use conventional commit |
Looks fine, but gitlab-ci is failing for the reasons unrelated to this PR. I'll try running it again later today. If that doesn't work, i'll test it locally and merge tomorrow. |
79891da
to
836daa0
Compare
Is there anything else you want to check or fix before merging? It looks fine to me, and i plan merge it tomorrow. |
No, let's go for it!
…On Thu, 7 Sep 2023, 14:51 Serhii Tereshchenko, ***@***.***> wrote:
Is there anything else you want to check or fix before merging?
It looks fine to me, and i plan merge it tomorrow.
—
Reply to this email directly, view it on GitHub
<#700 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKDJVU3YH44LKC2FR6ZANTXZG7NNANCNFSM6AAAAAA4EOS4UE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Closes #698, overlaps with #699 w/r to re-generated initial migrations
When django-modeltranslation creates the translation fields (foo_en, foo_de...) and the base field has a callable default set, any language-aware content is now translated with the field's language.
The mechanism is rather simple -
Field.get_default
is overridden to temporarily activatefield.language
.