projects
/
matthijs
/
upstream
/
django-ldapdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add test cases for qs.values(*fields) and qs.values_list(*fields)
[matthijs/upstream/django-ldapdb.git]
/
ldapdb
/
models
/
base.py
diff --git
a/ldapdb/models/base.py
b/ldapdb/models/base.py
index 363ae92fcfb912cbb2b623c876ee328a9e139680..41d00e8c684b3fa7483973a5478b888808cce290 100644
(file)
--- a/
ldapdb/models/base.py
+++ b/
ldapdb/models/base.py
@@
-1,7
+1,7
@@
# -*- coding: utf-8 -*-
#
# django-ldapdb
# -*- coding: utf-8 -*-
#
# django-ldapdb
-# Copyright (C) 2009 Bolloré telecom
+# Copyright (C) 2009
-2010
Bolloré telecom
# See AUTHORS file for a full list of contributors.
#
# This program is free software: you can redistribute it and/or modify
# See AUTHORS file for a full list of contributors.
#
# This program is free software: you can redistribute it and/or modify
@@
-60,6
+60,12
@@
class Model(django.db.models.base.Model):
super(Model, self).__init__(*args, **kwargs)
self.saved_pk = self.pk
super(Model, self).__init__(*args, **kwargs)
self.saved_pk = self.pk
+ def _collect_sub_objects(self, collector):
+ """
+ This private API seems to be called by the admin interface in django 1.2
+ """
+ pass
+
def build_rdn(self):
"""
Build the Relative Distinguished Name for this entry.
def build_rdn(self):
"""
Build the Relative Distinguished Name for this entry.
@@
-99,7
+105,7
@@
class Model(django.db.models.base.Model):
continue
value = getattr(self, field.name)
if value:
continue
value = getattr(self, field.name)
if value:
- entry.append((field.db_column,
value
))
+ entry.append((field.db_column,
field.get_db_prep_save(value, connection=ldapdb.connection)
))
logging.debug("Creating new LDAP entry %s" % new_dn)
ldapdb.connection.add_s(new_dn, entry)
logging.debug("Creating new LDAP entry %s" % new_dn)
ldapdb.connection.add_s(new_dn, entry)
@@
-119,7
+125,7
@@
class Model(django.db.models.base.Model):
new_value = getattr(self, field.name, None)
if old_value != new_value:
if new_value:
new_value = getattr(self, field.name, None)
if old_value != new_value:
if new_value:
- modlist.append((ldap.MOD_REPLACE, field.db_column,
new_value
))
+ modlist.append((ldap.MOD_REPLACE, field.db_column,
field.get_db_prep_save(new_value, connection=ldapdb.connection)
))
elif old_value:
modlist.append((ldap.MOD_DELETE, field.db_column, None))
elif old_value:
modlist.append((ldap.MOD_DELETE, field.db_column, None))