I would like to listen for pre_create_historical_record
signal provided by simple-history package but only from certain sender. The problem is that historical models are generated by simple-history and I can't figure out how can I import class "core.HistoricalUser" as a type to set as sender.
You can get to the model class by going through the history manager as documented here.
In your specific case something like – assuming your history manager is called history
and the model you are tracking history for is User
:
pre_create_historical_record.connect(
signal_receiver_function,
sender=User.history.model
)