Field obj.backend in _do_complete_obj
The obj.backend is traditionnaly filled by _store_result, in BackendsCall. It is to late to test the result in condition.
This commit is contained in:
parent
831d3c3038
commit
83e0f92be7
1 changed files with 2 additions and 1 deletions
|
|
@ -247,6 +247,7 @@ class BaseApplication(object):
|
||||||
return version
|
return version
|
||||||
|
|
||||||
def _do_complete_obj(self, backend, fields, obj):
|
def _do_complete_obj(self, backend, fields, obj):
|
||||||
|
obj.backend = backend.name
|
||||||
if fields is None or len(fields) > 0:
|
if fields is None or len(fields) > 0:
|
||||||
backend.fillobj(obj, fields)
|
backend.fillobj(obj, fields)
|
||||||
return obj
|
return obj
|
||||||
|
|
@ -254,12 +255,12 @@ class BaseApplication(object):
|
||||||
def _do_complete_iter(self, backend, count, fields, res):
|
def _do_complete_iter(self, backend, count, fields, res):
|
||||||
modif = 0
|
modif = 0
|
||||||
for i, sub in enumerate(res):
|
for i, sub in enumerate(res):
|
||||||
|
sub = self._do_complete_obj(backend, fields, sub)
|
||||||
if self.condition and not self.condition.is_valid(sub):
|
if self.condition and not self.condition.is_valid(sub):
|
||||||
modif += 1
|
modif += 1
|
||||||
else:
|
else:
|
||||||
if count and i - modif == count:
|
if count and i - modif == count:
|
||||||
raise MoreResultsAvailable()
|
raise MoreResultsAvailable()
|
||||||
sub = self._do_complete_obj(backend, fields, sub)
|
|
||||||
yield sub
|
yield sub
|
||||||
|
|
||||||
def _do_complete(self, backend, count, selected_fields, function, *args, **kwargs):
|
def _do_complete(self, backend, count, selected_fields, function, *args, **kwargs):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue