Skip to content

Get rid of unmaintained django-parler (fixes DEV-159)#552

Merged
aptiko merged 1 commit intoopenmeteo:masterfrom
aptiko:dev-159--parler
Mar 8, 2026
Merged

Get rid of unmaintained django-parler (fixes DEV-159)#552
aptiko merged 1 commit intoopenmeteo:masterfrom
aptiko:dev-159--parler

Conversation

@aptiko
Copy link
Copy Markdown
Member

@aptiko aptiko commented Mar 7, 2026

Checklist:

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 7, 2026

Codecov Report

❌ Patch coverage is 92.59259% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.58%. Comparing base (889531a) to head (aa75b6d).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
enhydris/models/timeseries_group.py 90.69% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/TranslatedFields from django-parler with a custom Variable model and VariableTranslation model, implementing a descr property 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 of baker.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.

@aptiko aptiko requested a review from Copilot March 8, 2026 15:42
@aptiko
Copy link
Copy Markdown
Member Author

aptiko commented Mar 8, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@aptiko aptiko force-pushed the dev-159--parler branch from 0809aea to aa75b6d Compare March 8, 2026 16:01
@aptiko aptiko merged commit aa75b6d into openmeteo:master Mar 8, 2026
3 checks passed
@aptiko aptiko deleted the dev-159--parler branch March 8, 2026 16:08
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.

2 participants