1. Curtis Maloney
  2. django-audittrail

Source

django-audittrail / audittrail / models.py

from django.db import models
from datetime import datetime

class Audit(models.Model):
    '''Audit trail for Student activity'''
    created = models.DateTimeField(default=datetime.now)
    user = models.ForeignKey('auth.User', related_name='audit_events')
    action = models.CharField(max_length=1024, db_index=True)
    details = models.TextField(blank=True)

    def __unicode__(self):
        return u'[%s] %s: %s' % (self.created, self.user.get_full_name(), self.action)

    class Meta:
        ordering = ('-created',)
        verbose_name = 'Audit Log'
        verbose_name_plural = 'Audit Logs'