diff options
Diffstat (limited to 'ipalib/crud.py')
-rw-r--r-- | ipalib/crud.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ipalib/crud.py b/ipalib/crud.py index 6d1a87f32..173fefc72 100644 --- a/ipalib/crud.py +++ b/ipalib/crud.py @@ -20,7 +20,7 @@ Base classes for standard CRUD operations. """ -import backend, frontend, parameters +import backend, frontend, parameters, output class Create(frontend.Method): @@ -28,6 +28,8 @@ class Create(frontend.Method): Create a new entry. """ + has_output = output.standard_entry + def get_args(self): if self.obj.primary_key: yield self.obj.primary_key.clone(attribute=True) @@ -53,18 +55,21 @@ class PKQuery(frontend.Method): yield self.obj.primary_key.clone(attribute=True, query=True) - class Retrieve(PKQuery): """ Retrieve an entry by its primary key. """ + has_output = output.standard_entry + class Update(PKQuery): """ Update one or more attributes on an entry. """ + has_output = output.standard_entry + def get_options(self): if self.extra_options_first: for option in super(Update, self).get_options(): @@ -75,17 +80,22 @@ class Update(PKQuery): for option in super(Update, self).get_options(): yield option + class Delete(PKQuery): """ Delete one or more entries. """ + has_output = output.standard_delete + class Search(frontend.Method): """ Retrieve all entries that match a given search criteria. """ + has_output = output.standard_list_of_entries + def get_args(self): yield parameters.Str('criteria?') @@ -176,4 +186,3 @@ class CrudBackend(backend.Connectible): this method should return an empty iterable. """ raise NotImplementedError('%s.search()' % self.name) - |