Adopte le comportement de python3 pour la division

Les deux seuls fichiers touchés sont `bda/views.py` et
`bda/algorithm.py` d'après un
`grep -r '/' . | grep '\.py' | grep -v '^Binary' à la racine du projet.
This commit is contained in:
Martin Pépin 2016-06-10 15:43:37 +02:00
parent 0261bcabf8
commit 2331304992
2 changed files with 7 additions and 3 deletions

View file

@ -1,5 +1,7 @@
# coding: utf-8
from __future__ import division
from django.conf import settings
from django.db.models import Max
@ -62,7 +64,7 @@ class Algorithm(object):
def __call__(self, seed):
random.seed(seed)
results = []
shows = sorted(self.shows, key = lambda x: float(x.nrequests) / x.slots, reverse = True)
shows = sorted(self.shows, key = lambda x: x.nrequests / x.slots, reverse = True)
for show in shows:
# On regroupe tous les gens ayant le même rang
groups = dict([(i, []) for i in range(1, self.max_group + 1)])