loggable.models module

class Loggable(log_type='database', max_entries=1000)[source]

Bases: object

Loggable manager that allows to add the funcionality of saving logs on the model instances.

get_meta_options(model)[source]

Gets a dictionary with the fields that will be added to the Meta inner class of the loggable model.

get_loggable_model_name(model)[source]

Gets the model name.

create_loggable_model(model)[source]

Creates the loggable model that will be related with the main model.

rotate_log(sender, instance, created, using=None, **kwargs)[source]

If the number of entries per foreign_key_field_name object is exceeded, the oldest ones are deleted.