diff options
author | Leif Johansson <leifj@sunet.se> | 2012-10-31 00:11:52 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2012-10-31 00:11:52 +0100 |
commit | ea0442b4797fdc34414d1b0c3153298e214766f6 (patch) | |
tree | f2b36f2a58c69a50308c67af345dd7d2f6401083 /meetingtools/apps/stats/management | |
parent | 0d218d69284497581c869ecc1606cfd173e87745 (diff) |
stats in DB
Diffstat (limited to 'meetingtools/apps/stats/management')
-rw-r--r-- | meetingtools/apps/stats/management/__init__.py | 1 | ||||
-rw-r--r-- | meetingtools/apps/stats/management/commands/__init__.py | 1 | ||||
-rw-r--r-- | meetingtools/apps/stats/management/commands/import_sessions.py | 20 |
3 files changed, 22 insertions, 0 deletions
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 <since> 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 |