money-manager/expenses/deletable_model.py
2023-09-17 16:54:34 +08:00

14 lines
312 B
Python

from django.db import models
from simple_history.models import HistoricalRecords
class DeletableModel(models.Model):
class Meta:
abstract = True
history = HistoricalRecords(inherit=True)
deleted = models.BooleanField(default=False)
def mark_deleted(self):
self.deleted = True