def handle(self, *args, **options): self.stdout.write("Syncing ...\n") sync = SyncServiceClass() try: r = sync.sync_expenses() except Exception, e: self.stdout.write("Error: %s\n" % str(e))
def cmd_expenses(request): sync = SyncServiceClass() try: r = sync.sync_expenses() except Exception, e: ret = '{"success":false, err: "%s"}' % (str(e))