ajoute fin_connexion/adhesion_*datetime*
Parce que c'est plus facile à manipuler dans les templates.
This commit is contained in:
parent
5b66ae0095
commit
e46d1fe338
1 changed files with 6 additions and 0 deletions
|
@ -1012,6 +1012,12 @@ class proprio(CransLdapObject):
|
||||||
"""Retourne la date de fin d'adhésion"""
|
"""Retourne la date de fin d'adhésion"""
|
||||||
return max([float(facture.get('finAdhesion', [crans_utils.from_generalized_time_format(attributs.finAdhesion.default)])[0]) for facture in self.factures(refresh=True, mode="ro") if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != ''] + [0.0])
|
return max([float(facture.get('finAdhesion', [crans_utils.from_generalized_time_format(attributs.finAdhesion.default)])[0]) for facture in self.factures(refresh=True, mode="ro") if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != ''] + [0.0])
|
||||||
|
|
||||||
|
def fin_connexion_datetime(self):
|
||||||
|
return datetime.datetime.fromtimestamp(self.fin_connexion())
|
||||||
|
|
||||||
|
def fin_adhesion_datetime(self):
|
||||||
|
return datetime.datetime.fromtimestamp(self.fin_adhesion())
|
||||||
|
|
||||||
def fin_connexion(self):
|
def fin_connexion(self):
|
||||||
"""Retourne la date de fin de connexion"""
|
"""Retourne la date de fin de connexion"""
|
||||||
return max([float(facture.get('finConnexion', [crans_utils.from_generalized_time_format(attributs.finConnexion.default)])[0]) for facture in self.factures(refresh=True, mode="ro") if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != ''] + [0.0])
|
return max([float(facture.get('finConnexion', [crans_utils.from_generalized_time_format(attributs.finConnexion.default)])[0]) for facture in self.factures(refresh=True, mode="ro") if facture.get('controle', [''])[0] != u"FALSE" and facture.get('recuPaiement', [''])[0] != ''] + [0.0])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue