Précisions sur les événements créés "manuellement"
This commit is contained in:
parent
3cd6dd8682
commit
d4a12cadcd
@ -1436,13 +1436,15 @@ class Event(models.Model):
|
||||
recurrentimport = RecurrentImport.objects.filter(source=OuterRef("import_sources__0")).order_by().annotate(count=Func(F('id'), function='Count')).values('count')
|
||||
|
||||
|
||||
nb_manual_creation = Event.objects.filter(created_date__gte=start, created_date__lt=end, imported_date__isnull=True).count()
|
||||
nb_manual_creation = Event.objects.filter(created_date__gte=start, created_date__lt=end, imported_date__isnull=True, uuids__len=0).count()
|
||||
nb_local_copies = Event.objects.filter(created_date__gte=start, created_date__lt=end, imported_date__isnull=True, uuids__len__gt=0).count()
|
||||
|
||||
imported = Event.objects.filter(created_date__gte=start, created_date__lt=end, imported_date__isnull=False, uuids__len__gt=0).annotate(nb_rimport=Subquery(recurrentimport))
|
||||
|
||||
nb_manual_import = imported.filter(Q(import_sources__len=0)|Q(nb_rimport=0)).count()
|
||||
nb_first_import = imported.filter(nb_rimport__gt=0).count()
|
||||
|
||||
return {"when": (start, start + timedelta(days=when[1] - 1)), "nb_manual_creation": nb_manual_creation, "nb_manual_import": nb_manual_import, "nb_first_import": nb_first_import}
|
||||
return {"when": (start, start + timedelta(days=when[1] - 1)), "nb_manual_creation": nb_manual_creation, "nb_manual_import": nb_manual_import, "nb_first_import": nb_first_import, "nb_local_copies": nb_local_copies}
|
||||
|
||||
def get_count_modifications(when_list):
|
||||
return [Event.get_count_modification(w) for w in when_list]
|
||||
|
@ -8,6 +8,7 @@
|
||||
<th>Créations manuelles</th>
|
||||
<th>Imports manuels</th>
|
||||
<th>Imports automatiques</th>
|
||||
<th>Créations de copies locales</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -17,6 +18,7 @@
|
||||
<td>{{ m.nb_manual_creation }}</td>
|
||||
<td>{{ m.nb_manual_import }}</td>
|
||||
<td>{{ m.nb_first_import }}</td>
|
||||
<td>{{ m.nb_local_copies }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
Loading…
x
Reference in New Issue
Block a user