Add function method to aggregate areas

This is standalone for now - we'll plumb it in later.
This commit is contained in:
Ben Thorner
2021-08-24 15:01:53 +01:00
parent 12978f0a9a
commit a210d87dee
4 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
def aggregate_areas(areas):
areas = _aggregate_wards_by_local_authority(areas)
return areas
def _aggregate_wards_by_local_authority(areas):
return {
area.parent if area.id.startswith('wd20-')
else area for area in areas
}