Skip to content

Instantly share code, notes, and snippets.

View cb109's full-sized avatar
💭
🍴 🐘

Christoph Bülter cb109

💭
🍴 🐘
View GitHub Profile
@cb109
cb109 / track_data.py
Last active July 25, 2022 08:08 — forked from dcramer/track_data.py
Tracking changes on properties in Django
# Tested against Django 3.2.14.
from django.db.models.base import DEFERRED
def track_data(*fields):
"""Tracks property changes on a model instance.
Simplified version of David Cramer's gist:
https://gist.github.com/dcramer/730765