political-memory / political_memory

WARNING: this repository has now moved to https://git.laquadrature.net/memopol/memopol
https://memopol.lqdn.fr/
12 stars 2 forks source link

[WIP] Add import scripts for old data, fixes #58 #80

Closed njoyard closed 8 years ago

njoyard commented 8 years ago

This PR adds two import scripts for old memopol data.

Links to exported data:

Export old recommendation data to a |-separated CSV file with the following query:

SELECT CONCAT(r.description, '|', r.weight, '|', r.recommendation, '|',
    r.part, '|', p.title, '|', p.ponderation)
FROM votes_recommendation r
    LEFT JOIN votes_proposal p ON r.proposal_id = p.id
WHERE p.institution = 'EU'

Then run the import script using :

cat recommendations.csv | memopol_import_recommendations

Positions

Export old position data to a |-separated CSV file with the following query:

SELECT CONCAT(o.content, '|', o.url, '|', o.title, '|', ro.date, '|',
    r.first_name, '|', r.last_name)
FROM reps_opinion o
INNER JOIN reps_opinionrep ro ON ro.opinion_id = o.id
INNER JOIN reps_representative r ON r.id = ro.representative_id
WHERE o.institution='EU'

Then run the import script using :

cat positions.csv | memopol_import_positions
codecov-io commented 8 years ago

Current coverage is 71.92%

Merging #80 into master will decrease coverage by 15.87%

  1. 3 files (not in diff) in ...endations/migrations were deleted. more
  2. 2 files (not in diff) in ...ives_recommendations were modified. more
    • Misses +7
    • Hits +3
  3. 2 files (not in diff) in memopol were modified. more
  4. File ...tags/memopol_tags.py (not in diff) was deleted. more
  5. File ...ands/update_score.py (not in diff) was created. more
@@             master        #80   diff @@
==========================================
  Files            34         34          
  Lines           598        698   +100   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits            525        502    -23   
- Misses           73        196   +123   
  Partials          0          0          

Powered by Codecov. Last updated by eeb3b22...57e3db7