Add method to generate DN from attribute directly, without making RDN first.

This commit is contained in:
Pavel Zuna 2009-04-30 15:56:13 +02:00 committed by Rob Crittenden
parent 21ccdec860
commit 24790748fe

View File

@ -318,6 +318,16 @@ class ldap2(CrudBackend):
parent_dn = self.normalize_dn(parent_dn)
return u'%s,%s' % (rdn, parent_dn)
def make_dn_from_attr(self, attr, value, parent_dn=''):
"""
Make distinguished name from attribute.
Keyword arguments:
parent_dn -- DN of the parent entry (default '')
"""
rdn = self.make_rdn_from_attr(attr, value)
return self.make_dn_from_rdn(rdn, parent_dn)
def make_dn(self, entry_attrs, primary_key='cn', parent_dn=''):
"""
Make distinguished name from entry attributes.