only allow integer field to accept integers and strings, fixes #2835#2836
Merged
kevin-brown merged 1 commit intoencode:masterfrom Apr 20, 2015
Merged
only allow integer field to accept integers and strings, fixes #2835#2836kevin-brown merged 1 commit intoencode:masterfrom
kevin-brown merged 1 commit intoencode:masterfrom
Conversation
Contributor
|
I can't say I'm thrilled at the idea of doing type checking here, but I will point out that in Python 2 you also have to be able to handle Django itself handles this by calling |
Author
|
Thanks Kevin, good call. I adjusted and squashed the change. |
…s being stored as ints, fixes encode#2835. Match IntegerField validation with Django IntegerField, prevents decimal values being stored as ints, fixes encode#2835 On branch master
Contributor
|
LGTM |
kevin-brown
added a commit
that referenced
this pull request
Apr 20, 2015
only allow integer field to accept integers and strings, fixes #2835
Contributor
|
Looks good, thanks for making the change. |
Contributor
There was a problem hiding this comment.
- We should push this to
self.re_decimalas per in Django so that it's only compiled once. - We should comment that this regex substitution is so that we allow eg '1.0' as an int, but not '1.2'
Contributor
|
Coupla inline comments that would be good to resolve. |
tinchodipalma
added a commit
to tinchodipalma/django-rest-framework
that referenced
this pull request
May 25, 2015
The following items had a wrong href value: - Dont require pk strictly for related fields. (encode#2745, encode#2754) - Restrict integer field to integers and strings. (encode#2835, encode#2836)
Merged
This was referenced Mar 9, 2017
This was referenced Oct 16, 2017
This was referenced Oct 16, 2017
This was referenced Nov 6, 2017
This was referenced Nov 14, 2017
This was referenced Dec 10, 2017
This was referenced Dec 20, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.