Skip to content
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

update a model with DateTime field using pendulum.now() #755

Closed
BSN4 opened this issue Jul 10, 2022 · 0 comments · Fixed by #768
Closed

update a model with DateTime field using pendulum.now() #755

BSN4 opened this issue Jul 10, 2022 · 0 comments · Fixed by #768
Labels
bug An existing feature is not working as intended

Comments

@BSN4
Copy link
Contributor

BSN4 commented Jul 10, 2022

Describe the bug
seems pendulum.now() doesn't transform to .to_datetime_string() while updating a model
using pendulum.now().to_datetime_string() will fix the bug

To Reproduce

 order = Order.find(1)
 order.update({'completed_at': pendulum.now()})

doesn't work giving this error QueryException: Error binding parameter 0 - probably unsupported type. .

my model has __dates__ = ["completed_at"]

DB field type is datetime

Expected behavior
it should cast pendulum.now() to datetime string

What database are you using?

  • Type: mysql
  • Version 8
  • Masonite ORM: latest version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An existing feature is not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant