parler.signals module¶
The signals exist to make it easier to connect to automatically generated translation models.
To run additional code after saving, consider overwriting
save_translation() instead.
Use the signals as last resort, or to maintain separation of concerns.
pre_translation_init¶
- parler.signals.pre_translation_init¶
This is called when the translated model is initialized,
like pre_init.
Arguments sent with this signal:
senderAs above: the model class that just had an instance created.
instanceThe actual translated model that’s just been created.
argsAny arguments passed to the model.
kwargsAny keyword arguments passed to the model.
post_translation_init¶
- parler.signals.post_translation_init¶
This is called when the translated model has been initialized,
like post_init.
Arguments sent with this signal:
senderAs above: the model class that just had an instance created.
instanceThe actual translated model that’s just been created.
pre_translation_save¶
- parler.signals.pre_translation_save¶
This is called before the translated model is saved,
like pre_save.
Arguments sent with this signal:
senderThe model class.
instanceThe actual translated model instance being saved.
rawTruewhen the model is being created by a fixture.usingThe database alias being used
post_translation_save¶
- parler.signals.post_translation_save¶
This is called after the translated model has been saved,
like post_save.
Arguments sent with this signal:
senderThe model class.
instanceThe actual translated model instance being saved.
rawTruewhen the model is being created by a fixture.usingThe database alias being used
pre_translation_delete¶
- parler.signals.pre_translation_delete¶
This is called before the translated model is deleted,
like pre_delete.
Arguments sent with this signal:
senderThe model class.
instanceThe actual translated model instance being deleted.
usingThe database alias being used
post_translation_delete¶
- parler.signals.post_translation_delete¶
This is called after the translated model has been deleted,
like post_delete.
Arguments sent with this signal:
senderThe model class.
instanceThe actual translated model instance being deleted.
usingThe database alias being used