From: Stephen Finucane Date: Thu, 20 Oct 2016 07:28:54 +0000 (+0100) Subject: models: Remove Bundle.n_patches X-Git-Tag: v2.0.0-rc1~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a401c586ea821ae295e72f00a436ed5e957d20fe;p=thirdparty%2Fpatchwork.git models: Remove Bundle.n_patches It doesn't really do much for us. Less LOC = win. Signed-off-by: Stephen Finucane Reviewed-by: Daniel Axtens --- diff --git a/patchwork/models.py b/patchwork/models.py index 6f3257f9..51f97450 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -570,9 +570,6 @@ class Bundle(models.Model): patches = models.ManyToManyField(Patch, through='BundlePatch') public = models.BooleanField(default=False) - def n_patches(self): - return self.patches.all().count() - def ordered_patches(self): return self.patches.order_by('bundlepatch__order') diff --git a/patchwork/templates/patchwork/bundles.html b/patchwork/templates/patchwork/bundles.html index 2eebd262..45bdec51 100644 --- a/patchwork/templates/patchwork/bundles.html +++ b/patchwork/templates/patchwork/bundles.html @@ -27,7 +27,7 @@ {{ bundle.public_url }} {% endif %} - {{ bundle.n_patches }} + {{ bundle.patches.count }}