Open GeoWill opened 3 years ago
Random thoughts on this topic that you didn't ask for:
seats_total
on the organisation as it is really a function of the Organisation
and something else. e.g: Watford council has one mayor, but it also has 26 councillors so Watford Council / seats_total
=1 is conceptually wierd. Also the GLA has 25 total members (14 geographic, 11 additional) and although they're elected differently functionally they're all London Assembly members so London Assembly / seats_total
=11 would be properly odd.ElectedRole
or ElectionType
? That might be a slightly nicer way to express "there can only be one mayor of a place"?mayor.watford.watford.2018-05-03
etc. I've previously thought that another possible model for this would be that mayor/PCCs have an "invisible" divisionset with one division in it (but that is probably big).gla.a
is its own unique special snowflake and is special-cased everywhere. Again, I think the only reason it is like that is really to make the ID be gla.a.2021-05-06
not gla.a.a.2021-05-06
. Again another possible model would be that it exists as an 'invisible' region-like division (its basically the same as SP/Senedd regions except there is only one of them).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.
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 thatseats_contested
is only a property of the ballot, but it would be nice to have defaults forseats_total
somewhere.At the moment the default is essentially
1
: https://github.com/DemocracyClub/EveryElection/blob/dde5a199e5a3a4de3deb381e168a082a7152d8d0/every_election/apps/elections/utils.py#L230-L231So 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 theElectionType
andElectionSubType
models.I think my current preference would just be for an extra if statement in the
get_seats_contested
method.