mysociety / theyworkforyou

Keeping tabs on the UK's parliaments and assemblies
http://www.theyworkforyou.com/
Other
224 stars 50 forks source link

Display agreements #1762

Closed ajparsons closed 4 months ago

ajparsons commented 4 months ago

This PR adds basic support for displaying agreements in the Policy-for-MP page:

image

This doesn't directly deal with if agreements score for policies - that can be enabled after https://github.com/mysociety/theyworkforyou/pull/1755 is merged however.

ajparsons commented 4 months ago

Only minor structural thing, and much easier the way you've done it, is that it feels like you'd want to have a Policy object containing its divisions and its agreements together. But I don't suggest trying to rejig everything to enable that :)

Just for revisiting when this isn't fixed in 10 years time - do you mean like a policy->decisions that is a list of both?

In twfy-votes, there's a PolicyDecisionLink that can be specialised for Divisions or Agreements - the Policy object maintains two lists, but they can be combined easier. So could pull that concept back in at some point.

https://github.com/mysociety/twfy-votes/blob/main/src/twfy_votes/apps/policies/models.py#L163-L167

dracos commented 4 months ago

do you mean like a policy->decisions that is a list of both?

Sorry, no, wasn't clear, I didn't mean they'd be together as one list, but that they'd both be under one object for the policy, rather than be in two different things under Policies

ajparsons commented 4 months ago

Fixup commit fixes indenting