From e01b642392a9c78e8abfcc4d600a98343b1a1de5 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Wed, 6 Mar 2024 15:00:29 +0100 Subject: [PATCH] New Sector with_tender_stats queryset --- lemarche/sectors/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lemarche/sectors/models.py b/lemarche/sectors/models.py index bad1345d0..106da927d 100644 --- a/lemarche/sectors/models.py +++ b/lemarche/sectors/models.py @@ -55,6 +55,9 @@ def form_filter_queryset(self): def with_siae_stats(self): return self.annotate(siae_count_annotated=Count("siaes", distinct=True)) + def with_tender_stats(self): + return self.annotate(tender_count_annotated=Count("tenders", distinct=True)) + class Sector(models.Model): name = models.CharField(verbose_name="Nom", max_length=255)