The comment about RelatedField is not really relevant so removed that part, RelatedField isn't used at this point.
The idea with RelatedField is that it fetches the object (vs DnField which just returns a Dn).
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
return self.dn == other.dn
def __json__(self):
- """Automatically called by custom JSONEncoder class.
-
- When turning an object into json any fields of type RelatedField
- will also end up calling this method.
- """
- if self.dn is not None:
- return str(self.dn)
+ """Automatically called by custom JSONEncoder class."""
+ return self.as_dict()
@staticmethod
def get_base_dn(ldb):