Get rid of unmaintained django-parler (fixes DEV-159)#552
Get rid of unmaintained django-parler (fixes DEV-159)#552aptiko merged 1 commit intoopenmeteo:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #552 +/- ##
==========================================
+ Coverage 97.48% 97.58% +0.09%
==========================================
Files 55 55
Lines 3542 3560 +18
==========================================
+ Hits 3453 3474 +21
+ Misses 89 86 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22e2b5297c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR replaces the unmaintained django-parler library with a custom VariableTranslation model for handling multi-language variable descriptions in the Enhydris water data management system. The migration is done in three steps: creating a new translation table, copying data, then removing the old parler-managed table.
Changes:
- Replaced
TranslatableModel/TranslatedFieldsfrom django-parler with a customVariablemodel andVariableTranslationmodel, implementing adescrproperty with per-instance caching and language-aware resolution - Added three data migrations (0121-0123) to safely migrate existing translation data from parler's table schema to the new custom table
- Updated all tests across the codebase to use the new
Variable.objects.create()+variable.translations.create()pattern instead ofbaker.make(Variable, descr=...)
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
enhydris/models/timeseries_group.py |
Core change: replaces parler-based Variable with plain Django model, adds VariableTranslation model, custom VariableManager, and descr property with caching |
enhydris/models/__init__.py |
Exports new VariableTranslation model |
enhydris/admin/__init__.py |
Replaces TranslatableAdmin with ModelAdmin + TabularInline for translations |
enhydris/api/serializers.py |
Replaces TranslatableModelSerializer with ModelSerializer + SerializerMethodField for translations |
enhydris/api/views.py |
Adds Prefetch for variable translations in the CSV endpoint |
enhydris_project/settings/__init__.py |
Removes parler from INSTALLED_APPS |
enhydris_project/settings/ci.py |
Removes PARLER_LANGUAGES setting |
enhydris/migrations/0121_remove_parler_part1.py |
Creates NewVariableTranslation table |
enhydris/migrations/0122_remove_parler_part2.py |
Copies data from old parler table to new table |
enhydris/migrations/0123_remove_parler_part3.py |
Deletes old table, renames new table |
enhydris/tests/test_models/test_timeseries_group.py |
Updates Variable tests for new translation model |
enhydris/tests/test_models/test_timeseries.py |
Updates query count assertions and cache clearing for new translation queries |
enhydris/tests/test_models/test_gentity.py |
Updates variable creation pattern |
enhydris/tests/__init__.py |
Updates test mixins for new translation pattern |
enhydris/tests/admin/test_station.py |
Updates variable creation pattern |
enhydris/api/tests/test_views/*.py |
Updates API tests for new variable creation and translation assertions |
enhydris/api/tests/test_serializers.py |
Updates serializer test for new variable creation |
enhydris/autoprocess/tests/test_models/*.py |
Updates autoprocess tests for new variable creation |
enhydris/telemetry/tests/test_models.py |
Updates telemetry tests for new variable creation |
enhydris/synoptic/tests/data.py |
Updates synoptic test data for new variable creation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0809aea934
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Checklist: