LDAP ORM
James Andrewartha
jamesa at daa.com.au
Mon Oct 22 15:48:01 CEST 2007
On Mon, 2007-10-22 at 15:05 +0200, Michael Ströder wrote:
> James Andrewartha wrote:
> >
> > --- cidict.py~ 2003-08-25 00:28:12.000000000 +0800
> > +++ cidict.py 2007-10-22 20:16:54.000000000 +0800
> > @@ -43,6 +43,9 @@
> > def has_key(self,key):
> > return UserDict.has_key(self,lower(key))
> >
> > + def __contains__(self,key):
> > + return UserDict.has_key(self,lower(key))
> > +
> > def get(self,key,failobj=None):
> > try:
> > return self[key]
>
> I'd prefer if it's ok for you:
>
> def __contains__(self,key):
> return self.has_key(self,key)
Sure, I was just copying has_key().
> If you're using ldap.schema you might want to look into using class
> ldap.schema.models.Entry instead of simply ldap.cidict.cidict because
> you don't have to care about attribute description aliases and mapping
> them to OIDs.
I'm happy with the setup I've got now, but if I ever need to deal with
attribute OIDs then I'll look into it.
James Andrewartha
More information about the python-ldap
mailing list