I'm using the simple_history package for Django and would like to record whether the user creates, updates or deletes a model object. I thought I'd use the history change reason for that purpose and in models.py do something like
def save(...):
if not self.id:
self.id = uuid()
self.changeReason = 'create'
else:
self.changeReason = 'update'
super(MyModel, self).save(...)
When I save the model this 'changeReason' field seems to be set (at least there are no errors) but when I try to read it in a test case like .history.first().instance.changeReason it complains that the field 'changeReason' does not exist. The history.first() call works so I do have a history record.
I have SIMPLE_HISTORY_HISTORY_CHANGE_REASON_USE_TEXT_FIELD = True in settings.py
I'm probably overlooking something basic but I can't seem to figure out what...
Thanks,