def get_all_expired(self, expires): """Get all expired task results.""" return self.filter(date_done__lt=now() - maybe_timedelta(expires))
def changed(cls, instance, **kwargs): if not instance.no_changes: cls.objects.update_or_create(ident=1, defaults={'last_update': now()})