Replies: 1 comment
-
|
@codot-fr This is expected Django behavior. When loading fixtures the model instances may not have all their attributes. You will be interested in the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm a bit lost. I have created a function to create a celery beat task on a post save signal for child objects of a polymorphic class. When the signal is triggered while django is running, all is working fine. However, when the signal is triggered while loading fixtures (manage.py loaddata), two weird issues arise:
1/ The id field and the pk field of the instance doesn't match
2/ field inherited from the parent polymorphic class aren't set (the name field)
Models:
When triggered via loaddata, the name attribute is not retrieved and the pk/id fields do not match.
When triggerd via regular instance create, the name attribute is retrieved and the pk/id fields match.
Any idea why polymorphic acts differently ?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions