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.
raw
True when 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.
raw
True when the model is being created by a fixture.
using
The 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:

sender
The model class.
instance
The actual translated model instance being deleted.
using
The 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:

sender
The model class.
instance
The actual translated model instance being deleted.
using
The database alias being used