Skip to content

Rewrite score computing, fixes #69

njoyard requested to merge rewrite-scores-fcb1226b into master

Created by: njoyard

This PR removes static, asynchronous representative score updates by replacing plain models with views in the representatives_recommendations app:

  • votescores computes the score consequence of each vote on the representative score ; it is mapped to the new VoteScore model that replaces ScoredVote (which extended Vote and computed scores in python).
  • dossierscores was introduced in a previous changeset but was rewritten to use votescores; it aggregates votes over proposals from a single dossier and returns the score contribution of each dossier on representatives scores. It is mapped to the DossierScore model.
  • representativescore aggregates scores from the dossierscores view over all dossiers for each representative and gives a direct queryable access to the score of each representative. It is mapped to the RepresentativeScore model.

This PR also removes score update facilities as they now don't have any use.

TL;DR: no more manual score updates, scores are computed on the fly.

Merge request reports

Loading