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

QueryBuilder.update() does not respect model __casts__ #831

Closed
1 task
zombeer opened this issue Nov 20, 2022 · 6 comments
Closed
1 task

QueryBuilder.update() does not respect model __casts__ #831

zombeer opened this issue Nov 20, 2022 · 6 comments
Labels
enhancement A feature that exists, works as intended but needs to be improved feature request A feature that does not yet exist but will be a good addition to the library

Comments

@zombeer
Copy link

zombeer commented Nov 20, 2022

Describe the feature as you'd like to see it
In my code I rely on models casts for some fields. As far as I can see it's implemented everywhere in model methods, but querybuilder ones.
It would be really nice to have consistent behavior over all Model/QueryBuilder methods.
In order for change to be non breaking I suggest to add cast=False kwarg to QueryBuilder.update() to preserve current state of things by default.

What do we currently have to do now?
To be exact:
I have to call Model.update(..) with some ugly json.dumps(...) inside while having json casts enabled in model.

  • Is this a breaking change?
@zombeer zombeer added enhancement A feature that exists, works as intended but needs to be improved feature request A feature that does not yet exist but will be a good addition to the library labels Nov 20, 2022
@zombeer
Copy link
Author

zombeer commented Nov 20, 2022

PR attached (:
#832

@circulon
Copy link
Contributor

Related to #759

@zombeer
Copy link
Author

zombeer commented Nov 22, 2022

Related to #759

Yep. But I suggest to implement non breaking change though.

@stoutput
Copy link
Contributor

Also addressed in #830

@stoutput
Copy link
Contributor

This has been fixed in #830

@josephmancuso
Copy link
Member

closing then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature that exists, works as intended but needs to be improved feature request A feature that does not yet exist but will be a good addition to the library
Projects
None yet
Development

No branches or pull requests

4 participants