Add metadata for the selfservice and delegation plugins.

This commit is contained in:
Rob Crittenden 2010-12-13 23:13:04 -05:00 committed by Adam Young
parent cd7b64103b
commit e0a39234f7
2 changed files with 28 additions and 0 deletions

View File

@ -86,6 +86,9 @@ class delegation(Object):
Delegation object.
"""
bindable = False
object_name = 'delegation',
object_name_plural = 'delegation',
label = _('Delegation')
takes_params = (
@ -118,6 +121,17 @@ class delegation(Object):
),
)
def __json__(self):
json_friendly_attributes = (
'label', 'takes_params', 'bindable', 'name',
'object_name', 'object_name_plural',
)
json_dict = dict(
(a, getattr(self, a)) for a in json_friendly_attributes
)
json_dict['methods'] = [m for m in self.methods]
return json_dict
api.register(delegation)

View File

@ -67,6 +67,9 @@ class selfservice(Object):
Selfservice object.
"""
bindable = False
object_name = 'selfservice',
object_name_plural = 'selfservice',
label = _('Permissions')
takes_params = (
@ -89,6 +92,17 @@ class selfservice(Object):
),
)
def __json__(self):
json_friendly_attributes = (
'label', 'takes_params', 'bindable', 'name',
'object_name', 'object_name_plural',
)
json_dict = dict(
(a, getattr(self, a)) for a in json_friendly_attributes
)
json_dict['methods'] = [m for m in self.methods]
return json_dict
api.register(selfservice)