weegee: fix Base.find() to work with items that can follow different metas
This commit is contained in:
parent
597c700ff7
commit
e32a27bc53
|
@ -62,7 +62,13 @@ class WeegeeBase:
|
|||
|
||||
@classmethod
|
||||
def find(cls: TypeOf[B], context: WeegeeContext, pattern: str) -> list[B]:
|
||||
return [cls(context, Item.load(context.instance, name)) for name in Item.filter(context.instance, cls.get_name(pattern))]
|
||||
objects = []
|
||||
meta = cls.get_meta(context)
|
||||
for name in Item.filter(context.instance, cls.get_name(pattern)):
|
||||
item = Item.load(context.instance, name)
|
||||
if item.is_complete(meta):
|
||||
objects.append(cls(context, item, meta))
|
||||
return objects
|
||||
|
||||
@classmethod
|
||||
def load(cls: TypeOf[B], context: WeegeeContext, name: str, path: O[str] = None, restore: bool = False) -> B:
|
||||
|
|
Loading…
Reference in New Issue