Skip to content

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

Remove unused fields from Cart

Anna Siwikd1cf11d4b603
diff --git a/saleor/checkout/migrations/0007_merge_cart_with_checkout.py b/saleor/checkout/migrations/0007_merge_cart_with_checkout.py
index f0a44d28f6..e882696f3f 100644
--- a/saleor/checkout/migrations/0007_merge_cart_with_checkout.py
+++ b/saleor/checkout/migrations/0007_merge_cart_with_checkout.py
@@ -1,4 +1,4 @@
-# Generated by Django 2.0.3 on 2018-05-29 05:55
+# Generated by Django 2.0.3 on 2018-05-29 06:12
from django.db import migrations, models
import django.db.models.deletion
@@ -14,14 +14,26 @@ class Migration(migrations.Migration):
]
operations = [
+ migrations.AlterModelOptions(
+ name='cart',
+ options={},
+ ),
migrations.RemoveField(
model_name='cart',
name='checkout_data',
),
+ migrations.RemoveField(
+ model_name='cart',
+ name='last_status_change',
+ ),
migrations.RemoveField(
model_name='cart',
name='status',
),
+ migrations.RemoveField(
+ model_name='cart',
+ name='total',
+ ),
migrations.RemoveField(
model_name='cart',
name='voucher',
diff --git a/saleor/checkout/models.py b/saleor/checkout/models.py
index ba58b0a9a8..2d06a8aeb1 100644
--- a/saleor/checkout/models.py
+++ b/saleor/checkout/models.py
@@ -35,15 +35,11 @@ class Cart(models.Model):
"""A shopping cart."""
created = models.DateTimeField(auto_now_add=True)
- last_status_change = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(
settings.AUTH_USER_MODEL, blank=True, null=True, related_name='carts',
on_delete=models.CASCADE)
email = models.EmailField(blank=True, default='')
token = models.UUIDField(primary_key=True, default=uuid4, editable=False)
- total = MoneyField(
- currency=settings.DEFAULT_CURRENCY, max_digits=12,
- decimal_places=settings.DEFAULT_DECIMAL_PLACES, default=0)
quantity = models.PositiveIntegerField(default=0)
billing_address = models.ForeignKey(
Address, related_name='+', editable=False, null=True,
@@ -63,9 +59,6 @@ class Cart(models.Model):
objects = CartQueryset.as_manager()
- class Meta:
- ordering = ('-last_status_change',)
-
def __repr__(self):
return 'Cart(quantity=%s)' % (self.quantity,)