Skip to content

Commit

Permalink
#43 掲載終了の通知情報を削除するスクリプト.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoneyan committed Sep 8, 2024
1 parent b7ac2b4 commit c07319d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dsbd/management/commands/db_auto_remove.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.core.management.base import BaseCommand
from django.utils import timezone

from notice.models import Notice


class Command(BaseCommand):
def handle(self, *args, **options):
print("batch process for db_auto_remove")
now = timezone.now()
# 掲載終了の通知情報を削除
Notice.objects.filter(end_at__lt=now).delete()

0 comments on commit c07319d

Please sign in to comment.