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

13 lines
421 B
Python

from django.core.management.base import NoArgsCommand
from eventplanner_gcal.google_sync import sync_from_local_to_google
class Command(NoArgsCommand):
help = 'Synchronize Google Calendar with locally stored Events'
def handle_noargs(self, **options):
print("Running Sync")
created, deleted = sync_from_local_to_google()
print("Created %d and deleted %d events" % (created, deleted))