Une fonction _id sur les objets pour rendre un peu plus facile leur gestion (bordel)
This commit is contained in:
parent
83a618de07
commit
a4042c9c3b
2 changed files with 13 additions and 1 deletions
12
objets.py
12
objets.py
|
@ -205,6 +205,18 @@ class CransLdapObject(object):
|
||||||
nvals = [nldif[attr][vals.index(v)] for v in vals ]
|
nvals = [nldif[attr][vals.index(v)] for v in vals ]
|
||||||
raise EnvironmentError("λv. str(Attr(v)) n'est peut-être pas une projection (ie non idempotente):", attr, nvals, vals)
|
raise EnvironmentError("λv. str(Attr(v)) n'est peut-être pas une projection (ie non idempotente):", attr, nvals, vals)
|
||||||
|
|
||||||
|
def _id(self):
|
||||||
|
"""Retourne l'id de l'objet courant"""
|
||||||
|
if isinstance(self, adherent):
|
||||||
|
return self['aid']
|
||||||
|
elif isinstance(self, machine):
|
||||||
|
return self['mid']
|
||||||
|
elif isinstance(self, club):
|
||||||
|
return self['cid']
|
||||||
|
elif isinstance(self, facture):
|
||||||
|
return self['fid']
|
||||||
|
else:
|
||||||
|
return [self.dn]
|
||||||
|
|
||||||
def _out_of_context(self, *args, **kwargs):
|
def _out_of_context(self, *args, **kwargs):
|
||||||
raise EnvironmentError("Hors du context, impossible de faire des écritures")
|
raise EnvironmentError("Hors du context, impossible de faire des écritures")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{["fid=",o.fid.0]|join|coul('bleu')}} {{"À : "|coul('gras')}}{{o.proprio().prenom|join(' ')}} {{o.proprio().nom|join(' ')}} ({{o.proprio().aid.0}})
|
{{["fid=",o._id().0]|join|coul('bleu')}} {{"À : "|coul('gras')}}{{o.proprio().prenom|join(' ')}} {{o.proprio().nom|join(' ')}} ({{o.proprio()._id().0}})
|
||||||
{% if o.article %}
|
{% if o.article %}
|
||||||
{{"Article : "|coul('gras')}} Prix N° Total Commentaire
|
{{"Article : "|coul('gras')}} Prix N° Total Commentaire
|
||||||
{% set total = [] %}{% for a in o.article %}
|
{% set total = [] %}{% for a in o.article %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue