Skip to content

Fix: Object identifier values function not parsing correctly path parameters when a field is DateTime#859

Open
co-incc wants to merge 1 commit intosmithyhq:mainfrom
co-incc:fix_composite_pk_with_datetime
Open

Fix: Object identifier values function not parsing correctly path parameters when a field is DateTime#859
co-incc wants to merge 1 commit intosmithyhq:mainfrom
co-incc:fix_composite_pk_with_datetime

Conversation

@co-incc
Copy link
Copy Markdown

@co-incc co-incc commented Dec 5, 2024

Related to #858

Comment thread sqladmin/helpers.py
type_ = get_column_python_type(pk)
value = False if type_ is bool and part == "False" else type_(part)
if type_ is datetime:
value = datetime.strptime(part, "%Y-%m-%d %H:%M:%S")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if datetime is in different format? Should we also consider date objecT?

Comment thread sqladmin/helpers.py
if type_ is datetime:
value = datetime.strptime(part, "%Y-%m-%d %H:%M:%S")
else:
print(part)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove print

@mmzeynalli mmzeynalli added waiting-for-feedback Waiting feedback/answer/updates from contributor needs-update There are stuff that needs updated and reviewed again labels Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-update There are stuff that needs updated and reviewed again waiting-for-feedback Waiting feedback/answer/updates from contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Object identifier values function not parsing correctly path parameters when a field is DateTime

2 participants