From 2ea9d7a1dee6e0c9f4a8b0cbb942d15e7167d199 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Tue, 7 Mar 2023 15:32:05 +0800 Subject: [PATCH] Added history field to product model --- ivy/products/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ivy/products/models.py b/ivy/products/models.py index 36e025b..aec772c 100644 --- a/ivy/products/models.py +++ b/ivy/products/models.py @@ -1,5 +1,6 @@ from django.db import models from django.utils.timezone import now +from simple_history.models import HistoricalRecords # Create your models here. @@ -7,6 +8,7 @@ class Product(models.Model): name = models.CharField(max_length=20) quantity = models.IntegerField(default=0) date_added = models.DateTimeField(default=now, editable=False) + history = HistoricalRecords() def __str__(self): return self.name