fix missing getitem

This commit is contained in:
relikd
2022-04-06 17:55:27 +02:00
parent 831cfa4e9c
commit a694149d04

View File

@@ -114,12 +114,10 @@ class GroupBySource(VirtualSourceObject):
return val[0] if val else None return val[0] if val else None
def __getitem__(self, key: str) -> Any: def __getitem__(self, key: str) -> Any:
# Used for virtual path resolver and |sort(attribute="x") filter # Used for virtual path resolver
if key in ('_path', '_alt'): if key in ('_path', '_alt'):
return getattr(self, key[1:]) return getattr(self, key[1:])
if hasattr(self, key): return self.__missing__(key) # type: ignore[attr-defined]
return getattr(self, key)
return None
def __lt__(self, other: 'GroupBySource') -> bool: def __lt__(self, other: 'GroupBySource') -> bool:
# Used for |sort filter ("group" is the provided original string) # Used for |sort filter ("group" is the provided original string)