Skip to content

Conversation

@JohananOppongAmoateng
Copy link
Contributor

@JohananOppongAmoateng JohananOppongAmoateng commented Jan 3, 2026

Users reported that when using loaddata to load fixtures for polymorphic models, post_save signal handlers receive instances with:

Mismatched pk and id fields
Missing parent class attributes (empty values)
This only occurs during loaddata, not during normal instance creation.

Root Cause
This is expected Django behavior for multi-table inheritance during deserialization, not a bug in django-polymorphic. Closes #502

@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.40%. Comparing base (0d30c86) to head (fa458d2).
⚠️ Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #792      +/-   ##
==========================================
- Coverage   83.44%   83.40%   -0.04%     
==========================================
  Files          26       27       +1     
  Lines        1649     1621      -28     
  Branches      264      255       -9     
==========================================
- Hits         1376     1352      -24     
+ Misses        207      206       -1     
+ Partials       66       63       -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
Collaborator

@bckohan bckohan left a comment

Choose a reason for hiding this comment

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

This is looking good thanks @JohananOppongAmoateng

I assume this is discussed in the django documentation? Can we add a link to it using intersphinx references? There's a shortcut for pulling down the intersphinx objects using just:

just fetch-refs django

@JohananOppongAmoateng
Copy link
Contributor Author

@bckohan added the refs

@bckohan
Copy link
Collaborator

bckohan commented Jan 5, 2026

On further consideration this is just normal Django behavior and I don't think it's our responsibility to document. The issue was converted to Q&A and answered.

@bckohan bckohan closed this Jan 5, 2026
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.

Instance attributes missing in post save signal triggered by loaddata

2 participants