DemocracyClub / EveryElection

:ballot_box_with_check: For recording every election in the UK
https://elections.democracyclub.org.uk/
BSD 3-Clause "New" or "Revised" License
11 stars 14 forks source link

Where should we keep seats_total for at large constituencies? #954

Open GeoWill opened 3 years ago

GeoWill commented 3 years ago

For elections with a Division, seats_total lives there. For 'at large' constituencies (gla.a, pcc, mayor) this doesn't work. I think it makes sense that seats_contested is only a property of the ballot, but it would be nice to have defaults for seats_total somewhere.
At the moment the default is essentially 1: https://github.com/DemocracyClub/EveryElection/blob/dde5a199e5a3a4de3deb381e168a082a7152d8d0/every_election/apps/elections/utils.py#L230-L231

So the simplest fix would be to special case gla in the same place. Alternatives would be adding it as a field to the Organisation model, or perhaps the ElectionType and ElectionSubType models.

I think my current preference would just be for an extra if statement in the get_seats_contested method.

chris48s commented 3 years ago

Random thoughts on this topic that you didn't ask for:

GeoWill commented 3 years ago

I assume

Probably big means a big change?

Given that where to store seats_total isn't a problem when there's a division (this covers almost all cases) and mayor and pcc elections can be easily handled in the code I'm not sure it's worth overhauling our model just for gla.a. What makes it special is that it's an at large constituency that elects more than one representative. Adding an extra line to set seats total on the gla.a ballot object in the builder seems like the simplest way forward.

If that's not satisfactory for some other reason, then I agree putting it on Organisation is weird. I think ElectionType makes more sense than ElectedRole in terms of mental model. For me the attraction of this approach is getting rid of the other places we keep seats_total - but if we did that we'd need to add it to ElectionSubType too, which is more of the same.