Changes between Version 20 and Version 21 of AuditTrail
- Timestamp:
- Mar 23, 2010, 4:23:23 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AuditTrail
v20 v21 245 245 """Create an audit trail manager based on the current object""" 246 246 class AuditTrailWithPkManager(manager.__class__): 247 def __init__(self): 247 def __init__(self, *arg, **kw): 248 super(AuditTrailWithPkManager, self).__init__(*arg, **kw) 248 249 self.model = manager.model 249 250 250 251 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 252 256 return AuditTrailWithPkManager() 253 257