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

10 lines
462 B
Python
Raw Normal View History

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, ) )