mirror of
https://github.com/Crocmagnon/checkout.git
synced 2024-11-22 16:18:03 +01:00
Delete categories when clearing
This commit is contained in:
parent
5998a280ba
commit
61edce6e69
1 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,13 @@
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from purchase.models import Basket, BasketItem, Cache, PaymentMethod, Product
|
from purchase.models import (
|
||||||
|
Basket,
|
||||||
|
BasketItem,
|
||||||
|
Cache,
|
||||||
|
PaymentMethod,
|
||||||
|
Product,
|
||||||
|
ProductCategory,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
@ -11,6 +18,7 @@ class Command(BaseCommand):
|
||||||
self.delete(Basket)
|
self.delete(Basket)
|
||||||
self.delete(Product)
|
self.delete(Product)
|
||||||
self.delete(PaymentMethod)
|
self.delete(PaymentMethod)
|
||||||
|
self.delete(ProductCategory)
|
||||||
Cache.get_solo().refresh()
|
Cache.get_solo().refresh()
|
||||||
|
|
||||||
def delete(self, cls):
|
def delete(self, cls):
|
||||||
|
|
Loading…
Reference in a new issue