equal
deleted
inserted
replaced
193 except (NoSelectableObject, ObjectNotFound): |
193 except (NoSelectableObject, ObjectNotFound): |
194 return None |
194 return None |
195 select_object = deprecated('[3.6] use select_or_none instead of select_object' |
195 select_object = deprecated('[3.6] use select_or_none instead of select_object' |
196 )(select_or_none) |
196 )(select_or_none) |
197 |
197 |
|
198 def selectable(self, oid, *args, **kwargs): |
|
199 """return all appobjects having the given oid that are |
|
200 selectable against the given context, in score order |
|
201 """ |
|
202 objects = [] |
|
203 for appobject in self[oid]: |
|
204 score = appobject.__select__(appobject, *args, **kwargs) |
|
205 if score > 0: |
|
206 objects.append((score, appobject)) |
|
207 return [obj(*args, **kwargs) |
|
208 for _score, obj in sorted(objects)] |
|
209 |
198 def possible_objects(self, *args, **kwargs): |
210 def possible_objects(self, *args, **kwargs): |
199 """return an iterator on possible objects in this registry for the given |
211 """return an iterator on possible objects in this registry for the given |
200 context |
212 context |
201 """ |
213 """ |
202 for appobjects in self.itervalues(): |
214 for appobjects in self.itervalues(): |