fix missing getitem
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user