[attributs] Liste d'attributs vide (jamais définie)
This commit is contained in:
parent
680446be8b
commit
94cacc6bdf
1 changed files with 9 additions and 2 deletions
11
lc_ldap.py
11
lc_ldap.py
|
@ -363,8 +363,15 @@ class CransLdapObject(object):
|
||||||
def __getitem__(self, attr):
|
def __getitem__(self, attr):
|
||||||
if self.mode in [ 'w', 'rw' ]:
|
if self.mode in [ 'w', 'rw' ]:
|
||||||
return [ v for v in self._modifs[attr] ]
|
return [ v for v in self._modifs[attr] ]
|
||||||
else:
|
elif self.attrs.has_key(attr):
|
||||||
return [ v for v in self.attrs[attr] ]
|
return [ v for v in self.attrs[attr] ]
|
||||||
|
elif self.has_key(attr):
|
||||||
|
return []
|
||||||
|
raise KeyError(attr)
|
||||||
|
|
||||||
|
def has_key(self,attr):
|
||||||
|
return attr in self.ofields or attr in self.xfields or\
|
||||||
|
attr in self.ufields or attr in self.mfields
|
||||||
|
|
||||||
def __setitem__(self, attr, values):
|
def __setitem__(self, attr, values):
|
||||||
if self.mode not in ['w', 'rw']:
|
if self.mode not in ['w', 'rw']:
|
||||||
|
@ -596,7 +603,7 @@ class machineCrans(machine):
|
||||||
ofields = machine.ofields + ['nombrePrises']
|
ofields = machine.ofields + ['nombrePrises']
|
||||||
|
|
||||||
class borneWifi(machine):
|
class borneWifi(machine):
|
||||||
ufields = machine.ufields + ['canal', 'puissane', 'hotspot',
|
ufields = machine.ufields + ['canal', 'puissance', 'hotspot',
|
||||||
'prise', 'positionBorne', 'nvram']
|
'prise', 'positionBorne', 'nvram']
|
||||||
|
|
||||||
class facture(CransLdapObject):
|
class facture(CransLdapObject):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue