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

Simplify translatable models to use a shared Mixin #257

Conversation

Samuel-Therrien-Beslogic
Copy link
Contributor

@Samuel-Therrien-Beslogic Samuel-Therrien-Beslogic commented Oct 1, 2024

Based on #256 to ensure no accidental DB changes, merge that one first Done

Please review/test carefully

Also based on discussions in: https://teams.microsoft.com/l/message/19:[email protected]/1727806176316?tenantId=cd34c2c6-a4f8-4af1-bdd5-497e97626cae&groupId=167b0d82-f8ec-429e-944f-45e9c370f2e3&parentMessageId=1727806102415&teamName=Beslogic%20-%20ARBRES%20Philanthropy&channelName=Pull%20Requests&createdTime=1727806176316
Original question:

Should all the *Internationalization classes/models be merged as the existing Internationalization ? I don't really see the need to split it up into multiple tables.
If so, I could then also simplify the serializers that handle translations.

@Samuel-Therrien-Beslogic Samuel-Therrien-Beslogic linked an issue Oct 1, 2024 that may be closed by this pull request
@Samuel-Therrien-Beslogic Samuel-Therrien-Beslogic marked this pull request as draft October 3, 2024 16:04
@Samuel-Therrien-Beslogic Samuel-Therrien-Beslogic changed the title Add django migration test Simplify translatable models to use a shared Mixin Oct 3, 2024
@Samuel-Therrien-Beslogic Samuel-Therrien-Beslogic marked this pull request as ready for review October 3, 2024 19:20
]

operations = [
migrations.AlterField(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

migration seems to only be good for if the db is empty, is it ok? Since FK won't be found in the other table unless we add them first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah probably better off squashing the migrations again to get devs to regenerate the DB (we won't be able to do that once we have real data on prod, but for now it's an easy shortcut)

@Samuel-Therrien-Beslogic Samuel-Therrien-Beslogic merged commit 16bbff2 into main Oct 22, 2024
4 checks passed
@Samuel-Therrien-Beslogic Samuel-Therrien-Beslogic deleted the 250-Create-a-mixin-class-for-Translatable-Django-models branch October 22, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a mixin class for Translatable Django models
2 participants