1 from datetime import date, timedelta
2 from django.core.management.base import BaseCommand
3 from stats.models import Visits, DayVisits
6 class Command(BaseCommand):
7 def add_arguments(self, parser):
9 '-s' ,'--since', metavar='YYYY-MM-DD',
13 '-u' ,'--until', metavar='YYYY-MM-DD',
18 def handle(self, **options):
19 since = date(*[int(p) for p in options['since'].split('-')])
20 until = date(*[int(p) for p in options['until'].split('-')])
23 DayVisits.build_day(since)