diff --git a/EDMS/db.sqlite3 b/EDMS/db.sqlite3 index 8997b35..844fc11 100644 Binary files a/EDMS/db.sqlite3 and b/EDMS/db.sqlite3 differ diff --git a/EDMS/shoppingCart/migrations/0012_auto_20201020_1637.py b/EDMS/shoppingCart/migrations/0012_auto_20201020_1637.py new file mode 100644 index 0000000..fb4e59d --- /dev/null +++ b/EDMS/shoppingCart/migrations/0012_auto_20201020_1637.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.2 on 2020-10-20 15:37 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0011_auto_20201019_1709'), + ] + + operations = [ + migrations.RenameField( + model_name='storeorder', + old_name='date_created', + new_name='date', + ), + ] diff --git a/EDMS/shoppingCart/migrations/0013_auto_20201020_1706.py b/EDMS/shoppingCart/migrations/0013_auto_20201020_1706.py new file mode 100644 index 0000000..6f24363 --- /dev/null +++ b/EDMS/shoppingCart/migrations/0013_auto_20201020_1706.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.2 on 2020-10-20 16:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('shoppingCart', '0012_auto_20201020_1637'), + ] + + operations = [ + migrations.AlterField( + model_name='storeorder', + name='date', + field=models.DateTimeField(), + ), + ] diff --git a/EDMS/shoppingCart/models.py b/EDMS/shoppingCart/models.py index cf661c8..2de2a2c 100644 --- a/EDMS/shoppingCart/models.py +++ b/EDMS/shoppingCart/models.py @@ -1,5 +1,6 @@ from django.db import models from django.contrib.auth.models import User +from datetime import timezone, datetime # Create your models here. @@ -52,7 +53,8 @@ class StoreOrder(models.Model): product = models.ForeignKey(Product, on_delete=models.SET_NULL, blank=True, null=True) status = models.CharField(max_length=200, null=True, choices=STATUS) quantity = models.IntegerField(default=0, null=True, blank=True) - date_created = models.DateTimeField(auto_now_add=True, null=True, blank=True) + date = models.DateTimeField(auto_now=0) + def __str__(self): return self.product.name \ No newline at end of file diff --git a/EDMS/shoppingCart/templates/shoppingCart/allocate.html b/EDMS/shoppingCart/templates/shoppingCart/allocate.html index fc927e1..62ebb1d 100644 --- a/EDMS/shoppingCart/templates/shoppingCart/allocate.html +++ b/EDMS/shoppingCart/templates/shoppingCart/allocate.html @@ -8,7 +8,7 @@