symposion_app/vendor/symposion/reviews
Sachi King 084c78e2cd Fix score calculation hack
I have no idea why we do this in the database as some magic after we
call save().  I also have no idea why MySQL is seeming to think we want
type BIGINT UNSIGNED at the end of the
((2 * '+2' + '+1') - ( '-1' + 2 * '-2')) but it does.

Setting it to 2.0 or float(2) doesn't get the ORM to get this right, but
we are going to Decimal and making the 2 multiplier be of type Decimal
manages to make the ORM pull it's shit together and use something that
seems like we're okay with.

+1, -2 = 1 / 2 = -0.5 Score == True
Looks like it works.

UPDATE `symposion_reviews_proposalresult` SET `score` = CASE WHEN `symposion_reviews_proposalresult`.`vote_count` = 0 THEN '0' ELSE ((((2 * `symposion_reviews_proposalresult`.`plus_two`) + `symposion_reviews_proposalresult`.`plus_one`) - (`symposion_reviews_proposalresult`.`minus_one` + (2 * `symposion_reviews_proposalresult`.`minus_two`))) / (`symposion_reviews_proposalresult`.`vote_count` * 1)) END WHERE `symposion_reviews_proposalresult`.`id` = 1
2017-08-08 15:37:33 +10:00
..
management Remove default name from create_review_permssions 2017-07-07 00:16:08 +10:00
migrations Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
templatetags Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
__init__.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
admin.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
apps.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
context_processors.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
forms.py Cleanup more user exploitable input with bleach 2017-08-07 20:13:10 +10:00
models.py Fix score calculation hack 2017-08-08 15:37:33 +10:00
urls.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
utils.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
views.py Order by ID rather than at last update time 2017-07-14 21:19:28 +10:00