From: Nicolas Cadou Date: Sat, 14 May 2011 02:08:06 +0000 (-0400) Subject: corrigé un bug dû à une fonction manquante X-Git-Tag: DAE~133^2~4^2 X-Git-Url: http://git.auf.org/?p=auf_rh_dae.git;a=commitdiff_plain;h=6e0bbb73187f8eb1fc268525c264339531210814 corrigé un bug dû à une fonction manquante --- diff --git a/project/rh/models.py b/project/rh/models.py index 4156a81..34d2819 100644 --- a/project/rh/models.py +++ b/project/rh/models.py @@ -775,7 +775,19 @@ class ValeurPoint(Metadata): class Meta: ordering = ['annee', 'implantation__nom'] - + + def get_tauxchange_courant(self): + """ + Recherche le taux courant associé à la valeur d'un point. + Tous les taux de l'année courante sont chargés, pour optimiser un + affichage en liste. (On pourrait probablement améliorer le manager pour + lui greffer le taux courant sous forme de JOIN) + """ + for tauxchange in self.tauxchange: + if tauxchange.implantation_id == self.implantation_id: + return tauxchange + return None + def __unicode__(self): tx = self.get_tauxchange_courant() if tx: