Changes between Version 13 and Version 14 of AuditTrail


Ignore:
Timestamp:
Aug 19, 2008, 1:43:56 PM (16 years ago)
Author:
Sergio Durand
Comment:

functions _contribute, _audit_track, _audit and _audit_delete are missing kwargs argmument (needed after r8223)

Legend:

Unmodified
Added
Removed
Modified
  • AuditTrail

    v13 v14  
    1515
    1616class Person(models.Model):
    17     first_name = models.CharField(maxlength=255)
    18     last_name = models.CharField(maxlength=255)
     17    first_name = models.CharField(max_length=255)
     18    last_name = models.CharField(max_length=255)
    1919    salary = models.PositiveIntegerField()
    2020
     
    155155    def contribute_to_class(self, cls, name):
    156156        # This should only get added once the class is otherwise complete
    157         def _contribute(sender):
     157        def _contribute(sender, **kwargs):
    158158            model = create_audit_model(sender, **self.opts)
    159159            descriptor = AuditTrailDescriptor(model._default_manager, sender._meta.pk.attname)
    160160            setattr(sender, name, descriptor)
    161161
    162             def _audit_track(instance, field_arr):
     162            def _audit_track(instance, field_arr, **kwargs):
    163163                field_name = field_arr[0]
    164164                try:
     
    172172                            return field_arr[2]
    173173
    174             def _audit(sender, instance, created):
     174            def _audit(sender, instance, created, **kwargs):
    175175                # Write model changes to the audit model.
    176176                # instance is the current (non-audit) model.
     
    193193
    194194            if self.opts['audit_deletes']:
    195                 def _audit_delete(sender, instance):
     195                def _audit_delete(sender, instance, **kwargs):
    196196                    # Write model changes to the audit model
    197197                    kwargs = {}
Back to Top