How to create a new objectClass in LDAP3?
<p>I'm trying to add entries into a 'policy' container I've created like so:</p>

<pre><code>ldap_connection.add('OU=Policy, DC=BERT, DC=LOCAL', 'organizationalUnit'))
</code></pre>

<p>and can't find any good documentation on how to create a new objectClass to accommodate these entries. If I try to add the entry using an objectClass that already exists like this:</p>

<pre><code>ldap_connection.add('CN=policy1, OU=Policy, DC=BERT, DC=LOCAL',attributes={'objectClass': 'person'})
</code></pre>

<p>that works. But I'd like to do something like this:</p>

<pre><code>ldap_connection.add('CN=policy1, OU=Policy, DC=BERT, DC=LOCAL',attributes={'objectClass': 'policy'})
</code></pre>

<p>I've tried using MODIFY_ADD:</p>

<pre><code>ldap_connection.modify('OU=Policy1, DC=BERT, DC=LOCAL',{'organizationalUnit': (MODIFY_ADD, ['policy'])})
</code></pre>

<p>but this returns an 'invalid attribute type in attribute' error that seems to persist no matter what values I switch out for 'organizationalUnit'. I scoured the internet for some sort of help regarding this matter, but the documentation on LDAP3 is quite sparse. Any help is much appreciated. </p>