noc.main.models.audittrail

Module Contents

noc.main.models.audittrail.logger
class noc.main.models.audittrail.FieldChange

Bases: mongoengine.document.EmbeddedDocument

meta
field
old
new
__str__(self)
class noc.main.models.audittrail.AuditTrail

Bases: mongoengine.document.Document

meta
timestamp
user
model_id
object
op
changes
expires
EXCLUDE
DEFAULT_TTL
_model_ttls
classmethod log(cls, sender, instance, op, changes)

Log into audit trail

classmethod get_field(cls, instance, field)
classmethod on_update_model(cls, sender, instance, **kwargs)

Audit trail for INSERT and UPDATE operations

classmethod on_delete_model(cls, sender, instance, **kwargs)

Audit trail for DELETE operation

classmethod on_init_model(cls, sender, instance, **kwargs)

Preserve original values

classmethod get_model_ttl(cls, model_id)
classmethod on_new_model(cls, sender, **kwargs)
classmethod install(cls)

Install signal handlers