-
Notifications
You must be signed in to change notification settings - Fork 14
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
Merged
Samuel-Therrien-Beslogic
merged 13 commits into
main
from
250-Create-a-mixin-class-for-Translatable-Django-models
Oct 22, 2024
Merged
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5a87cb2
Add django migration test
Samuel-Therrien-Beslogic 2049954
Add TranslatableModelMixin
Samuel-Therrien-Beslogic adfc1a1
Merge branch 'main' of https://github.com/BesLogic/releaf-canopeum in…
Samuel-Therrien-Beslogic 4b8984b
Simplify translatable models and serializers
Samuel-Therrien-Beslogic 5f7f27b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6ab94ed
Fix typing issue
Samuel-Therrien-Beslogic d060a81
Merge branch '250-Create-a-mixin-class-for-Translatable-Django-models…
Samuel-Therrien-Beslogic c49b9f1
Merge branch 'main' into 250-Create-a-mixin-class-for-Translatable-Dj…
Samuel-Therrien-Beslogic 0bf0271
Merge branch 'main' of https://github.com/BesLogic/releaf-canopeum in…
Samuel-Therrien-Beslogic 6f6d60f
Merge branch '250-Create-a-mixin-class-for-Translatable-Django-models…
Samuel-Therrien-Beslogic 7c3ada0
Update some init code
Samuel-Therrien-Beslogic bd0d6dd
Redo initial migration
Samuel-Therrien-Beslogic 887584b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...m_backend/migrations/0002_alter_fertilizertype_name_alter_mulchlayertype_name_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Generated by Django 5.1 on 2024-10-03 18:38 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("canopeum_backend", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="fertilizertype", | ||
name="name", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
to="canopeum_backend.internationalization", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="mulchlayertype", | ||
name="name", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
to="canopeum_backend.internationalization", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="sitetype", | ||
name="name", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
to="canopeum_backend.internationalization", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="treetype", | ||
name="name", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
to="canopeum_backend.internationalization", | ||
), | ||
), | ||
migrations.DeleteModel( | ||
name="FertilizertypeInternationalization", | ||
), | ||
migrations.DeleteModel( | ||
name="MulchlayertypeInternationalization", | ||
), | ||
migrations.DeleteModel( | ||
name="SitetypeInternationalization", | ||
), | ||
migrations.DeleteModel( | ||
name="TreespeciestypeInternationalization", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)