summaryrefslogtreecommitdiff
path: root/meetingtools/apps/stats/management/commands/import_sessions.py
blob: d98b081b3f7464c5c38a211a2ff8f77c1c9aa803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from optparse import make_option
from django.core.management import BaseCommand
from meetingtools.apps.stats.tasks import import_acc_sessions
from meetingtools.apps.cluster.models import ACCluster

__author__ = 'leifj'

class Command(BaseCommand):

    option_list = BaseCommand.option_list + (
        make_option('--since',
            type='int',
            dest='since',
            default=0,
            help='Import all sessions <since> seconds ago'),
        )

    def handle(self, *args, **options):
        for acc in ACCluster.objects.all():
            import_acc_sessions(acc,since=options['since'])