Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add last_updated field for delivery group

Artur Smęt4574a0409ae6
diff --git a/saleor/order/migrations/0005_deliverygroup_last_updated.py b/saleor/order/migrations/0005_deliverygroup_last_updated.py
new file mode 100644
index 0000000000..60247a37e2
--- /dev/null
+++ b/saleor/order/migrations/0005_deliverygroup_last_updated.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('order', '0004_order_total'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='deliverygroup',
+ name='last_updated',
+ field=models.DateTimeField(auto_now=True, null=True),
+ ),
+ ]
diff --git a/saleor/order/models.py b/saleor/order/models.py
index 2e321e7ca6..47c7acd27c 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -183,6 +183,7 @@ class DeliveryGroup(models.Model, ItemSet):
decimal_places=4,
default=0,
editable=False)
+ last_updated = models.DateTimeField(null=True, auto_now=True)
objects = DeliveryGroupManager()