From ea0442b4797fdc34414d1b0c3153298e214766f6 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Wed, 31 Oct 2012 00:11:52 +0100 Subject: stats in DB --- meetingtools/apps/stats/management/__init__.py | 1 + .../apps/stats/management/commands/__init__.py | 1 + .../stats/management/commands/import_sessions.py | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 meetingtools/apps/stats/management/__init__.py create mode 100644 meetingtools/apps/stats/management/commands/__init__.py create mode 100644 meetingtools/apps/stats/management/commands/import_sessions.py (limited to 'meetingtools/apps/stats/management') diff --git a/meetingtools/apps/stats/management/__init__.py b/meetingtools/apps/stats/management/__init__.py new file mode 100644 index 0000000..3929ed7 --- /dev/null +++ b/meetingtools/apps/stats/management/__init__.py @@ -0,0 +1 @@ +__author__ = 'leifj' diff --git a/meetingtools/apps/stats/management/commands/__init__.py b/meetingtools/apps/stats/management/commands/__init__.py new file mode 100644 index 0000000..3929ed7 --- /dev/null +++ b/meetingtools/apps/stats/management/commands/__init__.py @@ -0,0 +1 @@ +__author__ = 'leifj' diff --git a/meetingtools/apps/stats/management/commands/import_sessions.py b/meetingtools/apps/stats/management/commands/import_sessions.py new file mode 100644 index 0000000..d98b081 --- /dev/null +++ b/meetingtools/apps/stats/management/commands/import_sessions.py @@ -0,0 +1,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 seconds ago'), + ) + + def handle(self, *args, **options): + for acc in ACCluster.objects.all(): + import_acc_sessions(acc,since=options['since']) \ No newline at end of file -- cgit v1.1