Skip to content

Commit

Permalink
Fix multiple PK model containing boolean values (#670)
Browse files Browse the repository at this point in the history
Co-authored-by: Amin Alaee <[email protected]>
  • Loading branch information
ncarvajalc and aminalaee authored Nov 13, 2023
1 parent 9e163b4 commit 52df929
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sqladmin/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ def object_identifier_values(id_string: str, model: Any) -> tuple:
values = []
pks = get_primary_keys(model)
for pk, part in zip(pks, _object_identifier_parts(id_string, model)):
values.append(get_column_python_type(pk)(part))
type_ = get_column_python_type(pk)
value = False if type_ is bool and part == "False" else type_(part)
values.append(value)
return tuple(values)


Expand Down

0 comments on commit 52df929

Please sign in to comment.