mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 06:11:07 -05:00
21 lines
642 B
Python
21 lines
642 B
Python
# history_tracking/apps.py
|
|
from django.apps import AppConfig
|
|
|
|
|
|
class HistoryTrackingConfig(AppConfig):
|
|
default_auto_field = "django.db.models.BigAutoField"
|
|
name = "history_tracking"
|
|
|
|
def ready(self):
|
|
from .mixins import HistoricalChangeMixin
|
|
from .models import Park
|
|
|
|
models_with_history = [Park]
|
|
|
|
for model in models_with_history:
|
|
# Check if mixin is already applied
|
|
if HistoricalChangeMixin not in model.history.model.__bases__:
|
|
model.history.model.__bases__ = (
|
|
HistoricalChangeMixin,
|
|
) + model.history.model.__bases__
|