From cb6a2d4d917cc792508d3dbf1162ccd6c0548b2e Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Wed, 9 Feb 2022 09:30:37 +0100 Subject: [PATCH] #86 District column simplification * simplifies the fetching of districts for district column --- compensation/tables.py | 8 ++------ ema/tables.py | 4 +--- intervention/tables.py | 4 +--- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/compensation/tables.py b/compensation/tables.py index 5a3da24b..96888cc1 100644 --- a/compensation/tables.py +++ b/compensation/tables.py @@ -133,9 +133,7 @@ class CompensationTable(BaseTable, TableRenderMixin): Returns: """ - parcels = value.parcels.filter( - parcelintersection__calculated_on__isnull=False, - ).values_list( + parcels = value.get_underlying_parcels().values_list( "gmrkng", flat=True ).distinct() @@ -296,9 +294,7 @@ class EcoAccountTable(BaseTable, TableRenderMixin): Returns: """ - parcels = value.parcels.filter( - parcelintersection__calculated_on__isnull=False, - ).values_list( + parcels = value.get_underlying_parcels().values_list( "gmrkng", flat=True ).distinct() diff --git a/ema/tables.py b/ema/tables.py index bf3709de..f9689517 100644 --- a/ema/tables.py +++ b/ema/tables.py @@ -103,9 +103,7 @@ class EmaTable(BaseTable, TableRenderMixin): Returns: """ - parcels = value.parcels.filter( - parcelintersection__calculated_on__isnull=False, - ).values_list( + parcels = value.get_underlying_parcels().values_list( "gmrkng", flat=True ).distinct() diff --git a/intervention/tables.py b/intervention/tables.py index 96d17c59..f535039d 100644 --- a/intervention/tables.py +++ b/intervention/tables.py @@ -130,9 +130,7 @@ class InterventionTable(BaseTable, TableRenderMixin): Returns: """ - parcels = value.parcels.filter( - parcelintersection__calculated_on__isnull=False, - ).values_list( + parcels = value.get_underlying_parcels().values_list( "gmrkng", flat=True ).distinct()