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:
sender- As above: the model class that just had an instance created.
instance- The actual translated model that’s just been created.
args- Any arguments passed to the model.
kwargs- Any 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:
sender- As above: the model class that just had an instance created.
instance- The 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:
sender- The model class.
instance- The actual translated model instance being saved.
rawTruewhen the model is being created by a fixture.using- The 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:
sender- The model class.
instance- The actual translated model instance being saved.
rawTruewhen the model is being created by a fixture.using- The database alias being used