def save(self, *args, **kwargs):
        """Create or update periodic task and cron schedule in DB"""
        # Save first, because the periodic_task needs this object's ID
        super(_ScheduleModel, self).save(*args, **kwargs)

        do_save = False
        pt = self.periodic_task

        if not pt:
            pt = self._new_periodic_task()

        if not pt.crontab:
            pt.crontab = self._save_crontab(CrontabSchedule())
            do_save = True
        elif self.schedule != self.crontab_to_schedule(pt.crontab):
            self._save_crontab(pt.crontab)
            do_save = True  # Need to update PeriodicTask, because it will signal the Scheduler to reload

        if self.active != pt.enabled:
            pt.enabled = self.active
            do_save = True

        if not pt.pk:
            pt.save()  # New periodic task object
            self.periodic_task = pt
            self.save(update_fields=('periodic_task',))  # Update this object
        elif do_save:
            pt.save(update_fields=('enabled', 'crontab', 'date_changed'))  # Update periodic task