zoo_data: ajoute une méthode pour récupérer tous les jobs d'une classe d'action (#21198)

This commit is contained in:
Benjamin Dauvergne 2018-01-19 15:19:34 +01:00
parent 72a6dfee6c
commit 2baa23702d
1 changed files with 4 additions and 0 deletions

View File

@ -225,6 +225,10 @@ class JobQuerySet(QuerySet):
def set_unrecoverable_error(self):
return self.update(state=self.model.STATE_UNRECOVERABLE_ERROR)
def by_action(self, action_klass):
class_path = self.model.get_classpath(action_klass)
return self.filter(**{'content__$classpath': class_path})
class Job(models.Model):
'''Store synchronization messages sent to applications'''