Skip to content

Conversation

@JohananOppongAmoateng
Copy link
Contributor

@JohananOppongAmoateng JohananOppongAmoateng commented Dec 23, 2025

This PR addresses multiple issues to improve django-polymorphic's reliability and usability.
Q-objects couldn't accept string model references, causing circular dependency issues in Meta constraints when a base model needed to reference a derived model defined later.

Saving polymorphic objects from one database to another caused ForeignKeyViolation because polymorphic_ctype_id referenced ContentType IDs from the source database.

Database routers weren't respected - ContentType was always fetched from default database even when routers specified a different database.

Closes #486
Closes #505
Closes #446

@JohananOppongAmoateng JohananOppongAmoateng marked this pull request as draft December 23, 2025 13:22
@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.88%. Comparing base (9f5e0fc) to head (c47046a).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/polymorphic/query_translate.py 96.55% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #757      +/-   ##
==========================================
+ Coverage   78.28%   78.88%   +0.59%     
==========================================
  Files          26       26              
  Lines        1543     1591      +48     
  Branches      244      254      +10     
==========================================
+ Hits         1208     1255      +47     
- Misses        260      261       +1     
  Partials       75       75              

☔ 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.

@JohananOppongAmoateng JohananOppongAmoateng marked this pull request as ready for review December 23, 2025 14:51
@JohananOppongAmoateng JohananOppongAmoateng self-assigned this Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant