From e245b6da9bc87c23df64edcc240d49358f558ef7 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 18 Feb 2011 00:02:51 -0600 Subject: Updated json_metadata and i18n_messages. The json_metadata() has been updated to return ipa.Objects and ipa.Methods. The i18n_messages() has been updated to include other messages that are not available from the metadata. --- ipalib/plugins/baseldap.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ipalib/plugins/baseldap.py') diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 2d25219d..2e284274 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -620,6 +620,16 @@ class LDAPCreate(CallbackInterface, crud.Create): def exc_callback(self, keys, options, exc, call_func, *call_args, **call_kwargs): raise exc + # list of attributes we want exported to JSON + json_friendly_attributes = ( + 'takes_options', + ) + + def __json__(self): + json_dict = dict( + (a, getattr(self, a)) for a in self.json_friendly_attributes + ) + return json_dict class LDAPQuery(CallbackInterface, crud.PKQuery): """ -- cgit