Skip to content

Commit

Permalink
Cast pk_values to list during conctanation with list
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Aug 21, 2024
1 parent e0870f1 commit 8a741f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastlite/kw.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get(self:Table, pk_values: list|tuple|str|int, as_cls:bool=True)->Any:
if not isinstance(pk_values, (list, tuple)): pk_values = [pk_values]
last_pk = pk_values[0] if len(self.pks) == 1 else pk_values
xtra = getattr(self, 'xtra_id', {})
vals = pk_values + list(xtra.values())
vals = list(pk_values) + list(xtra.values())
pks = self.pks + list(xtra.keys())
if len(pks)!=len(vals): raise NotFoundError(f"Need {len(pks)} pk")
wheres = ["[{}] = ?".format(pk_name) for pk_name in pks]
Expand Down

0 comments on commit 8a741f6

Please sign in to comment.