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

Object of type datetime is not JSON serializable #475

Closed
yubarajshrestha opened this issue Jul 7, 2021 · 2 comments · Fixed by #476
Closed

Object of type datetime is not JSON serializable #475

yubarajshrestha opened this issue Jul 7, 2021 · 2 comments · Fixed by #476
Labels
bug An existing feature is not working as intended

Comments

@yubarajshrestha
Copy link
Contributor

There's an issue with dates if you use QueryBuilder.

To Reproduce
Add few records into any model. For now let's, use "User" model. There are two ways to get the users list from database, 1st one is using User model 2nd one is using QueryBuilder. Querying using Model works perfectly fine but with QueryBuilder it gives error.

Screen Shot 2021-07-07 at 6 40 34 PM

Working Code

users = User.get()
return users

Not Working

users = QueryBuilder().table("users").get()
return users

There are times when we have to use QueryBuilder, for which date parsing in json is giving issue. __dates__ in model is also not helping.

@yubarajshrestha yubarajshrestha added the bug An existing feature is not working as intended label Jul 7, 2021
@josephmancuso
Copy link
Member

Fixed in version 1.0.53

@yubarajshrestha
Copy link
Contributor Author

Fixed in version 1.0.53

It's not working... Still getting same issue.

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.

2 participants