Skip to content

Instantly share code, notes, and snippets.

@csarcom
Created April 2, 2014 14:11
Show Gist options
  • Save csarcom/9934966 to your computer and use it in GitHub Desktop.
Save csarcom/9934966 to your computer and use it in GitHub Desktop.
class History(models.Model):
changed_by = models.ForeignKey('user.CustomUser', null=True, blank=True)
history = HistoricalRecords()
@property
def _history_user(self):
return self.changed_by
@_history_user.setter
def _history_user(self, value):
self.changed_by = value
class CustomUser(AbstractBaseUser, PermissionsMixin, History):
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment