8000 QueryList: Better object handling by tony · Pull Request #415 · vcs-python/libvcs · GitHub
[go: up one dir, main page]

Skip to content

QueryList: Better object handling #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
QueryList: Better object handling
  • Loading branch information
tony committed Sep 17, 2022
commit 1c873a5b09e5777c9ffda3094956349e868c5857
8 changes: 6 additions & 2 deletions src/libvcs/_internal/query_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ def keygetter(
sub_fields = path.split("__")
dct = obj
for sub_field in sub_fields:
dct = dct[sub_field]
if isinstance(dct, dict):
dct = dct[sub_field]
elif hasattr(dct, sub_field):
dct = getattr(dct, sub_field)
return dct
except Exception:
except Exception as e:
traceback.print_stack()
print(f"Above error was {e}")
return None


Expand Down
0