grantmcconnaughey / django-field-history

A Django app to track changes to model fields.
BSD 3-Clause "New" or "Revised" License
314 stars 33 forks source link

Add post_field_history_bulk_create signal #35

Closed fceruti closed 2 years ago

fceruti commented 5 years ago

I needed a way to have a "post_save" signal that was triggered after FieldHistory instances where created. This implementation is working fine for what I needed.

I have to note thou that this will only work with postgres as other database connections do not return the list of instances after bulk_create. I created this pull request more as a conversation starter than an actual pull request.

https://github.com/django/django/blob/330638b89f14e1fb06e9d313ccc9768ae167c53f/django/db/models/query.py#L483