diff options
author | Leif Johansson <leifj@sunet.se> | 2012-10-21 00:03:48 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2012-10-21 00:03:48 +0200 |
commit | 1907bfa78a3f2364e0856507c78e5eb09a1692f1 (patch) | |
tree | 1789948066fa9dfaea1de08fd081dc5d555a2330 /meetingtools/apps/room/management/commands | |
parent | 519b09da29a0ab620e85f1dc32816dd248f5f12d (diff) |
option for since
Diffstat (limited to 'meetingtools/apps/room/management/commands')
-rw-r--r-- | meetingtools/apps/room/management/commands/import_rooms.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meetingtools/apps/room/management/commands/import_rooms.py b/meetingtools/apps/room/management/commands/import_rooms.py index 7944be8..abdc696 100644 --- a/meetingtools/apps/room/management/commands/import_rooms.py +++ b/meetingtools/apps/room/management/commands/import_rooms.py @@ -1,3 +1,4 @@ +from optparse import make_option from django.core.management import BaseCommand from meetingtools.apps.cluster.models import ACCluster from meetingtools.apps.room.tasks import import_acc @@ -6,6 +7,14 @@ __author__ = 'leifj' class Command(BaseCommand): + option_list = BaseCommand.option_list + ( + make_option('--since', + type='int', + dest='since', + default=0, + help='Import all rooms modified <since> seconds ago'), + ) + def handle(self, *args, **options): for acc in ACCluster.objects.all(): - import_acc(acc,since=0)
\ No newline at end of file + import_acc(acc,since=options['since'])
\ No newline at end of file |