docbow/docbow_project/docbow/management/commands/clean-documents.py

15 lines
372 B
Python

from django.core.management.base import BaseCommand
from ... import models
class Command(BaseCommand):
'''Undelete all documents'''
help = 'Undelete all documents'
def handle(self, *args, **options):
count = models.Document.objects.count()
models.Document.objects.all().delete()
print('Definitively deleted %d documents.' % count)