Skip to content

Commit 89689c7

Browse files
committed
Wrap the deletion functionality in a management command
1 parent a397857 commit 89689c7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.core.management.base import BaseCommand
2+
from django_dbq.models import Job
3+
4+
5+
class Command(BaseCommand):
6+
7+
help = "Delete old jobs"
8+
9+
def handle(self, *args, **options):
10+
Job.objects.delete_old()
11+
self.stdout.write('Deleted old jobs')

0 commit comments

Comments
 (0)