symposion_app/vendor/symposion
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
..
conference Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
locale Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
proposals Other suggested django migrations 2017-07-02 22:38:38 +10:00
reviews Fix score calculation hack 2017-08-08 15:37:33 +10:00
schedule Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
speakers Travel assistance to sydney please 2017-07-31 22:48:49 +10:00
sponsorship Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
static Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
teams Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
utils 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
conf.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
constants.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
LICENSE Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
models.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
text_parser.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00
views.py Taking one out of PyCon's (US) book 2017-05-27 20:11:39 +10:00