Metaclass for all LDAP models.
"""
def __new__(cls, name, bases, attrs):
- attr_meta = attrs.get('Meta', None)
- if attr_meta:
- dn = attr_meta._dn
- object_classes = attr_meta._object_classes
+ attr_meta = attrs.pop('Ldap', None)
super_new = super(ModelBase, cls).__new__
new_class = super_new(cls, name, bases, attrs)
new_class._default_manager.get_query_set = get_query_set
if attr_meta:
- new_class._meta.dn = dn
- new_class._meta.object_classes = attr_meta._object_classes
+ new_class._meta.dn = attr_meta.dn
+ new_class._meta.object_classes = attr_meta.object_classes
return new_class