def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def _every_weekday(job, weekday, loop=None):
    return every(job, timedelta=timedelta(days=7), start_at=_nearest_weekday(weekday), loop=loop)