mirror of
https://github.com/Crocmagnon/checkout.git
synced 2024-11-21 23:58:02 +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 purchase.models import Basket, BasketItem, Cache, PaymentMethod, Product
|
||||
from purchase.models import (
|
||||
Basket,
|
||||
BasketItem,
|
||||
Cache,
|
||||
PaymentMethod,
|
||||
Product,
|
||||
ProductCategory,
|
||||
)
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
@ -11,6 +18,7 @@ class Command(BaseCommand):
|
|||
self.delete(Basket)
|
||||
self.delete(Product)
|
||||
self.delete(PaymentMethod)
|
||||
self.delete(ProductCategory)
|
||||
Cache.get_solo().refresh()
|
||||
|
||||
def delete(self, cls):
|
||||
|
|
Loading…
Reference in a new issue