GCal Mapping: Management commands and signals
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from eventplanner_gcal.models import syncGCalEvents
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Synchronize Google Calendar with locally stored Events'
|
||||
|
||||
def handle(self, **options):
|
||||
print ( "Running Sync")
|
||||
syncGCalEvents()
|
||||
9
eventplanner_gcal/management/commands/gcal_delete_all.py
Normal file
9
eventplanner_gcal/management/commands/gcal_delete_all.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from eventplanner_gcal.models import deleteAllGCalEvents
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
help = 'Delete all events in the google calendar created by this app'
|
||||
def handle_noargs(self, **options):
|
||||
print ("Deleting all GCal Events.")
|
||||
nrOfDeletedEvents = deleteAllGCalEvents()
|
||||
print ("Deleted %d events. To Restore them from local database run gcal_sync" % (nrOfDeletedEvents, ) )
|
||||
10
eventplanner_gcal/management/commands/gcal_sync.py
Normal file
10
eventplanner_gcal/management/commands/gcal_sync.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.core.management.base import NoArgsCommand
|
||||
|
||||
from eventplanner_gcal.models import syncGCalEvents
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
help = 'Synchronize Google Calendar with locally stored Events'
|
||||
def handle_noargs(self, **options):
|
||||
print ( "Running Sync")
|
||||
created, deleted = syncGCalEvents()
|
||||
print ( "Created %d and deleted %d events" % (created,deleted) )
|
||||
Reference in New Issue
Block a user