# meta-data
base_dn = None
+ search_scope = ldap.SCOPE_SUBTREE
object_classes = ['top']
def __init__(self, *args, **kwargs):
Build the Relative Distinguished Name for this entry.
"""
bits = []
- for field in self._meta.local_fields:
- if field.primary_key:
+ for field in self._meta.fields:
+ if field.db_column and field.primary_key:
bits.append("%s=%s" % (field.db_column, getattr(self, field.name)))
if not len(bits):
raise Exception("Could not build Distinguished Name")
entry = [('objectClass', self.object_classes)]
new_dn = self.build_dn()
- for field in self._meta.local_fields:
+ for field in self._meta.fields:
if not field.db_column:
continue
value = getattr(self, field.name)
record_exists = True
modlist = []
orig = self.__class__.objects.get(pk=self.saved_pk)
- for field in self._meta.local_fields:
+ for field in self._meta.fields:
if not field.db_column:
continue
old_value = getattr(orig, field.name, None)
self.saved_pk = self.pk
signals.post_save.send(sender=self.__class__, instance=self, created=(not record_exists))
+ def validate_unique(self, exclude=None):
+ #Â FIXME: we are bypassing the unicity checks, as they break
+ # the admin interface
+ pass
+
@classmethod
def scoped(base_class, base_dn):
"""