[lc_ldap, objets] vivent les __repr__

This commit is contained in:
Valentin Samir 2014-02-23 00:02:00 +01:00
parent 7df0a4e1a0
commit 99ba3a8915
2 changed files with 20 additions and 2 deletions

View file

@ -610,7 +610,7 @@ class proprio(CransLdapObject):
attribs = [attributs.nom, attributs.chbre, attributs.paiement, attributs.info, attributs.blacklist, attributs.controle, attributs.historique]
def __repr__(self):
return str(self.__class__) + " : " + str(self['nom'][0])
return str(self.__class__) + " : nom=" + str(self['nom'][0])
def __init__(self, conn, dn, mode='ro', ldif=None):
super(proprio, self).__init__(conn, dn, mode, ldif)
@ -720,7 +720,7 @@ class machine(CransLdapObject):
attributs.dnsIpv6, attributs.machineAlias]
def __repr__(self):
return str(self.__class__) + " : " + str(self['host'][0])
return str(self.__class__) + " : host=" + str(self['host'][0])
def __init__(self, conn, dn, mode='ro', ldif = None):
super(machine, self).__init__(conn, dn, mode, ldif)
@ -883,6 +883,9 @@ class adherent(proprio):
]
ldap_name = "adherent"
def __repr__(self):
return str(self.__class__) + " : aid=" + str(self['aid'][0])
def __init__(self, conn, dn, mode='ro', ldif=None):
super(adherent, self).__init__(conn, dn, mode, ldif)
self.full = False
@ -967,6 +970,9 @@ class club(proprio):
attribs = proprio.attribs + [attributs.cid, attributs.responsable, attributs.imprimeurClub]
ldap_name = "club"
def __repr__(self):
return str(self.__class__) + " : cid=" + str(self['cid'][0])
@crans_object
class machineFixe(machine):
u"""Machine fixe"""
@ -1050,6 +1056,9 @@ class facture(CransLdapObject):
_proprio = None
def __repr__(self):
return str(self.__class__) + " : fid=" + str(self['fid'][0])
#### GROS HACK pour rester comptatible avec ldap_crans où l'article representant les frais n'est ajouté qu'une fois le paiement reçu
def __init__(self, conn, dn, mode='ro', ldif=None):
super(facture, self).__init__(conn, dn, mode, ldif)
@ -1098,6 +1107,9 @@ class baseCert(CransLdapObject):
_machine = None
def __repr__(self):
return str(self.__class__) + " : xid=" + str(self['xid'][0])
def __init__(self, conn, dn, mode='ro', ldif=None):
super(baseCert, self).__init__(conn, dn, mode, ldif)
if "TLSACert" in self['objectClass']: