James Andrewartha jamesa at daa.com.au
Mon Oct 22 14:53:48 CEST 2007

Hi all,

The current Python LDAP interface is a bit low level for my liking, so
I've started work on an LDAP ORM[1]. Currently there's very little RM
going on, but I have got a nice Python object representing an LDAP
object with attribute access and deletion, no adding or saving to the
ldap server just yet. ldap.schema is really quite handy. 

Which brings me to my next point - could someone update the API docs on
the website? They're 3.5 years out of date, and so missing things like
ldap.schema and cidict.

Here's a patch for cidict to implement __contains__, which makes foo in
somecidict work right:

--- 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):
       return self[key]

Anyway, I'd appreciate any comments or suggestions (including for a new
name) on LDAP ORM. I have a vague goal of being able to use LDAP as an
ORM for Django or whatever other web framework tickles your fancy.

[1] http://trs80.ucc.asn.au/ldaporm.py

James Andrewartha

More information about the python-ldap mailing list