from datetime import date

from django.core.management.base import BaseCommand

from staff.map.models import TableBook


class Command(BaseCommand):
    help = 'Deletes expired entries from table_book'

    def handle(self, *args, **options):
        TableBook.objects.filter(date_to__lt=date.today).delete()
