This commit is contained in:
Виктор Гладких 2019-11-21 14:33:27 +03:00
parent 938b9436eb
commit 9a2f7fec39

View File

@ -101,14 +101,12 @@ class Command(BaseCommand):
p.tags.clear() p.tags.clear()
print('End clear tags product') print('End clear tags product')
def remove_tags(self): def remove_tags(self):
print('Begin delete many tags') print('Begin delete many tags')
Tag.objects.\ Tag.objects.\
filter(news__isnull=True, establishments__isnull=True).delete() filter(news__isnull=True, establishments__isnull=True).delete()
print('End delete many tags') print('End delete many tags')
def product_sql(self): def product_sql(self):
with connections['legacy'].cursor() as cursor: with connections['legacy'].cursor() as cursor:
cursor.execute(''' cursor.execute('''