Changes between Version 20 and Version 21 of AuditTrail


Ignore:
Timestamp:
Mar 23, 2010, 4:23:23 PM (15 years ago)
Author:
Spark23
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AuditTrail

    v20 v21  
    245245    """Create an audit trail manager based on the current object"""
    246246    class AuditTrailWithPkManager(manager.__class__):
    247         def __init__(self):
     247        def __init__(self, *arg, **kw):
     248            super(AuditTrailWithPkManager, self).__init__(*arg, **kw)
    248249            self.model = manager.model
    249250
    250251        def get_query_set(self):
    251             return super(AuditTrailWithPkManager, self).get_query_set().filter(**{pk_attribute: pk})
     252            qs = super(AuditTrailWithPkManager, self).get_query_set().filter(**{pk_attribute: pk})
     253            if self._db is not None:
     254                qs = qs.using(self._db)
     255            return qs
    252256    return AuditTrailWithPkManager()
    253257
Back to Top