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
Ticket #22210: Saving Model instance to Float Field #2404
Conversation
val = val.prepare_database_save(field) | ||
else: | ||
raise TypeError("Database is trying to update a relational field " | ||
"with a value of type %s. Please check you are " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have an %s
in the error message, but you aren't formatting the string with a parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I will fix it now
Hi guys, any update on this? |
Looks good to me, as long as all the tests pass. @PirosB3 you'll want to squash all the commits into a single commit to make it easier for the core team to merge. There is one line that may raise some concerns:
There really isn't a better way of checking, IMO, and a similar check is done in other places (like sql/query and gis/query). |
@jarshwah thanks for the comments. I will look at sql/query to see if they can be improved! |
No problem. No need to look at sql/query, that was just a reference for others to see that isinstance(.., ExpressionNode) is used elsewhere also. isinstance checks are usually discouraged, which is why I described why I think it is necessary here. |
Thanks, fixed in 819e09b (with release notes) |
This is the first time I contribute to Django, please let me know if I need to adjust something :)