def get_logging_fields(self, model):
        """
        Returns a dictionary mapping of the fields that are used for
        keeping the acutal audit log entries.
        """
        rel_name = '_%s_audit_log_entry'%model._meta.object_name.lower()


        def entry_instance_to_unicode(log_entry):
            try:
                result = '%s: %s %s at %s'%(model._meta.object_name,
                                                log_entry.object_state,
                                                log_entry.get_action_type_display().lower(),
                                                log_entry.action_date,

                                                )
            except __HOLE__:
                result = '%s %s at %s'%(model._meta.object_name,
                                                log_entry.get_action_type_display().lower(),
                                                log_entry.action_date

                                                )
            return result

        action_user_field = LastUserField(related_name = rel_name, editable = False)

        #check if the manager has been attached to auth user model
        if [model._meta.app_label, model.__name__] == getattr(settings, 'AUTH_USER_MODEL', 'auth.User').split("."):
            action_user_field = LastUserField(related_name = rel_name, editable = False, to = 'self')

        return {
            'action_id' : models.AutoField(primary_key = True),
            'action_date' : models.DateTimeField(default = datetime_now, editable = False, blank=False),
            'action_user' : action_user_field,
            'action_type' : models.CharField(max_length = 1, editable = False, choices = (
                ('I', _('Created')),
                ('U', _('Changed')),
                ('D', _('Deleted')),
            )),
            'object_state' : LogEntryObjectDescriptor(model),
            '__unicode__' : entry_instance_to_unicode,
        }
dataset/ETHPy150Open Atomidata/django-audit-log/audit_log/models/managers.py/AuditLog.get_logging_fields