on affiche le dernier status
This commit is contained in:
parent
909b73d729
commit
a7f5645cf1
@ -789,6 +789,10 @@ class RecurrentImport(models.Model):
|
|||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse("view_rimport", kwargs={"pk": self.pk})
|
return reverse("view_rimport", kwargs={"pk": self.pk})
|
||||||
|
|
||||||
|
def last_import(self):
|
||||||
|
events = BatchImportation.objects.filter(recurrentImport=self).order_by("-created_date")
|
||||||
|
return events[0]
|
||||||
|
|
||||||
|
|
||||||
class BatchImportation(models.Model):
|
class BatchImportation(models.Model):
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
<th>Id</th>
|
<th>Id</th>
|
||||||
<th>Nom</th>
|
<th>Nom</th>
|
||||||
<th>Récurrence</th>
|
<th>Récurrence</th>
|
||||||
<th>Nombre d'imports</th>
|
<th>Nb d'imports</th>
|
||||||
|
<th>Dernier</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -33,6 +34,13 @@
|
|||||||
<td>{{ obj.name }}</a></td>
|
<td>{{ obj.name }}</a></td>
|
||||||
<td>{{ obj.get_recurrence_display }}</td>
|
<td>{{ obj.get_recurrence_display }}</td>
|
||||||
<td>{{ obj.nb_imports }}</td>
|
<td>{{ obj.nb_imports }}</td>
|
||||||
|
<td>
|
||||||
|
{% if obj.nb_imports > 0 %}
|
||||||
|
{% with imp=obj.last_import %}
|
||||||
|
<span{% if imp.status == "failed" %} data-tooltip="{{ imp.error_message }}"{% endif %}>{{ imp.status }}</span>
|
||||||
|
{% endwith %}
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<a href="{% url 'run_rimport' obj.pk %}" role="button">Exécuter</a>
|
<a href="{% url 'run_rimport' obj.pk %}" role="button">Exécuter</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user