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
Add ExposeMissing context manager #261
Conversation
This implementation is totally sub-optimal. It misses a nice point of the context variable, which is that we could put the context manager at the dump method level rather than the get_attribute level. This is another reason to like the context_var approach better than the current one. |
Rebased on master.
|
ded7dd1
to
e970e80
Compare
Also rename FromUmongoSchema to RemoveMissingSchema
e970e80
to
07f2715
Compare
Finally, this is the first part of a rework followed in #299 that removes |
This makes the Document responsible for outputing missing rather than the schema having to guess. Also the schema works with any type of data, not only a Document instance (with other data, the context manger is no-op).
I hoped to remove the whole
mongo_world
management thanks to this, but there are other issues with data from Mongo vs. Document.The benefit is not as great as I expected, but I still like this implementation.