blechreiz-website/eventplanner_gcal/management/commands/gcal_delete_all.py

12 lines
477 B
Python
Raw Normal View History

from django.core.management.base import NoArgsCommand
2019-01-05 13:04:20 +01:00
from eventplanner_gcal.google_sync import delete_all_gcal_events
class Command(NoArgsCommand):
help = 'Delete all events in the google calendar created by this app'
2019-01-05 13:04:20 +01:00
def handle_noargs(self, **options):
2019-01-05 13:04:20 +01:00
print("Deleting all GCal Events.")
nr_of_deleted_events = delete_all_gcal_events()
print("Deleted %d events. To Restore them from local database run gcal_sync" % (nr_of_deleted_events,))