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
Override fields not init #7
Commits on Feb 7, 2017
-
Jervis Whitley committed
Feb 7, 2017 Configuration menu - View commit details
-
Copy full SHA for eacd6a3 - Browse repository at this point
Copy the full SHA eacd6a3View commit details -
Failing test shows serializer keyerror when nested.
Jervis Whitley committedFeb 7, 2017 Configuration menu - View commit details
-
Copy full SHA for 334cf2a - Browse repository at this point
Copy the full SHA 334cf2aView commit details -
the test case should pass now if there were no bug.
Jervis Whitley committedFeb 7, 2017 Configuration menu - View commit details
-
Copy full SHA for a3c70e0 - Browse repository at this point
Copy the full SHA a3c70e0View commit details -
avoid access to self.context - it is cached.
Prevent access to it, since it will be run and cached even when serializer is initialized as nested.
Jervis Whitley committedFeb 7, 2017 Configuration menu - View commit details
-
Copy full SHA for 478baa9 - Browse repository at this point
Copy the full SHA 478baa9View commit details -
added some sanity checks for normal operation.
Jervis Whitley committedFeb 7, 2017 Configuration menu - View commit details
-
Copy full SHA for aa1fae6 - Browse repository at this point
Copy the full SHA aa1fae6View commit details -
warn only if the params/GET attributes are missing from
request
.Previously it would warn if they were present but empty.
Configuration menu - View commit details
-
Copy full SHA for d71f829 - Browse repository at this point
Copy the full SHA d71f829View commit details -
__init__ is called when creating the serializer instance. It can be during the request cycle or at django start time (nested serializer). Instead do the fields filtering logic directly in the `fields` property. Internal and external methods and properties use this public API for working with fields. It should be safe to assume `fields` is only accessed during the request cycle, so fetching `self.context` is assumed safe.
Jervis Whitley committedFeb 7, 2017 Configuration menu - View commit details
-
Copy full SHA for da85b37 - Browse repository at this point
Copy the full SHA da85b37View commit details -
prevent filtering before request cycles have begun.
This situation would occur if someone was accessing `fields` during their own custom __init__ method.
Configuration menu - View commit details
-
Copy full SHA for 9456e92 - Browse repository at this point
Copy the full SHA 9456e92View commit details -
This came from using the cookie-cutter template
I'm not convinced it is required.
Configuration menu - View commit details
-
Copy full SHA for 28ed1a5 - Browse repository at this point
Copy the full SHA 28ed1a5View commit details -
try to keep the linter happy in github.
I thought the code quality was good, but it requires docstrings on everything.
Configuration menu - View commit details
-
Copy full SHA for e08ccda - Browse repository at this point
Copy the full SHA e08ccdaView commit details