projets
/
auf_rh_dae.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7bd32fb
)
corrigé un bug dû à une fonction manquante
author
Nicolas Cadou
<ncadou@cadou.ca>
Sat, 14 May 2011 02:08:06 +0000
(22:08 -0400)
committer
Nicolas Cadou
<ncadou@cadou.ca>
Sat, 14 May 2011 02:08:06 +0000
(22:08 -0400)
project/rh/models.py
patch
|
blob
|
blame
|
history
diff --git
a/project/rh/models.py
b/project/rh/models.py
index
4156a81
..
34d2819
100644
(file)
--- a/
project/rh/models.py
+++ b/
project/rh/models.py
@@
-775,7
+775,19
@@
class ValeurPoint(Metadata):
class Meta:
ordering = ['annee', 'implantation__nom']
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:
def __unicode__(self):
tx = self.get_tauxchange_courant()
if tx: