diff options
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r-- | ipalib/plugins/dns.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index 85a0d822..77bec45f 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -187,6 +187,21 @@ class dns(Object): ), ) + default_attributes = _zone_default_attributes + + json_friendly_attributes = ( + 'default_attributes', 'label', 'name', 'takes_params' ) + + def __json__(self): + json_dict = dict( + (a, getattr(self, a)) for a in self.json_friendly_attributes + ) + if self.primary_key: + json_dict['primary_key'] = self.primary_key.name + json_dict['methods'] = [m for m in self.methods] + return json_dict + + api.register(dns) |