-
-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
History changes do not get tracked for ManyToMany field #614
Comments
How are you calling these? As |
When I call |
That's where we connect to post_save and post_delete signals. Would also want to connect to the |
Thanks. I will take a look. |
Just wanted to chime in here that I've just run into this issue, and a quick work-around that seems to be working ok for me to at least get create changes to be recorded is to call create instead of add, e.g. for @martasd code example above: BeoOrganizer.objects.create(beo=beo_instance, organizer=organizer_instance) instead of beo_instance.organizers.add(organizer_instance) |
Also see #399 |
This seems either resolved or stale, so closing. Please reopen if that's not the case 🙂 |
I have a model called Beo with a ManyToMany field
organizers
using athrough
model as suggested here:To use django-simple-history with multiple models, I have created an abstract class called HistoryModel, which creates historical records:
When I make changes to a Beo instance, history gets recorded as expected for beo instance itself. Everything works well here. When I make changes to organizers of a beo, however, the only changes recorded in beo_historicalbeoorganizer table are deletions (
history_type
is-
). Neither creations nor updates get recorded.To Reproduce
Steps to reproduce the behavior:
+
history_type record DOES NOT get created for the ManyToMany field.Expected behavior
+
history_type record DOES get created for the ManyToMany field.Environment
The text was updated successfully, but these errors were encountered: