diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-10-20 20:28:24 -0600 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-10-20 20:28:24 -0600 |
commit | 461f547e6ae29df72534cce65eb490a7898c1f0a (patch) | |
tree | 266f821c2f0a726b1735116b3b6ac41a19a3301a /ipalib/frontend.py | |
parent | c818fe1d2d9ab87c5291ead043784a9d68f95448 (diff) | |
download | freeipa-461f547e6ae29df72534cce65eb490a7898c1f0a.tar.gz freeipa-461f547e6ae29df72534cce65eb490a7898c1f0a.tar.xz freeipa-461f547e6ae29df72534cce65eb490a7898c1f0a.zip |
Added docstring (with example) to frontend.Attribute class
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r-- | ipalib/frontend.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py index dbbb2bc5..e0d6fa78 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -857,6 +857,40 @@ class Object(plugable.Plugin): class Attribute(plugable.Plugin): + """ + Base class implementing the attribute-to-object association. + + `Attribute` plugins are associated with an `Object` plugin to group + a common set of commands that operate on a common set of parameters. + + The association between attribute and object is done using a simple + naming convention: the first part of the plugin class name (up to the + first underscore) is the object name, and rest is the attribute name, + as this table shows: + + ============= =========== ============== + Class name Object name Attribute name + ============= =========== ============== + user_add user add + noun_verb noun verb + door_open_now door open_door + ============= =========== ============== + + For example: + + >>> class user_add(Attribute): + ... pass + ... + >>> instance = user_add() + >>> instance.obj_name + 'user' + >>> instance.attr_name + 'add' + + In practice the `Attribute` class is not used directly, but rather is + only the base class for the `Method` and `Property` classes. Also see + the `Object` class. + """ __public__ = frozenset(( 'obj', 'obj_name', |