From cfc8450efd92dc0fb6648e97b27416c67625adfb Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 14 Oct 2008 22:22:01 -0400 Subject: Port user-show to new CrudBackend framework --- ipalib/crud.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ipalib/crud.py') diff --git a/ipalib/crud.py b/ipalib/crud.py index 5a60ac8c..5cd7b0a4 100644 --- a/ipalib/crud.py +++ b/ipalib/crud.py @@ -87,12 +87,14 @@ class CrudBackend(backend.Backend): """ raise NotImplementedError('%s.create()' % self.name) - def retrieve(self, primary_key): + def retrieve(self, primary_key, attributes): """ Retrieve an existing entry. - This method should take a single argument, the primary_key of the - entry in question. + This method should take a two arguments: the primary_key of the + entry in question and a list of the attributes to be retrieved. + If the list of attributes is None then all non-operational + attributes will be returned. If such an entry exists, this method should return a dict representing that entry. If no such entry exists, this method -- cgit From e7937f294445d53396f7fb87d52eb4d4c9b97110 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 15 Oct 2008 09:57:49 -0400 Subject: Add missing * to *kw to make it pass named arguments instead of positional --- ipalib/crud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ipalib/crud.py') diff --git a/ipalib/crud.py b/ipalib/crud.py index 5cd7b0a4..ba4d5718 100644 --- a/ipalib/crud.py +++ b/ipalib/crud.py @@ -70,7 +70,7 @@ class CrudBackend(backend.Backend): Base class defining generic CRUD backend API. """ - def create(self, *kw): + def create(self, **kw): """ Create a new entry. @@ -102,7 +102,7 @@ class CrudBackend(backend.Backend): """ raise NotImplementedError('%s.retrieve()' % self.name) - def update(self, primary_key, *kw): + def update(self, primary_key, **kw): """ Update an existing entry. -- cgit