Skip to content

Instantly share code, notes, and snippets.

@robhardwick
Created October 1, 2018 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robhardwick/6fd98bb61fc395a4d0be72f6268ace85 to your computer and use it in GitHub Desktop.
Save robhardwick/6fd98bb61fc395a4d0be72f6268ace85 to your computer and use it in GitHub Desktop.
from django.db import models
from django.conf import settings
class AuditMixin:
"""Standard created/modified audit fields."""
created_at = models.DateTimeField(auto_now_add=True)
created_by = models.ForeignKey(settings.AUTH_USER_MODEL)
modified_at = models.DateTimeField(auto_now=True)
modified_by = models.ForeignKey(settings.AUTH_USER_MODEL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment