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

ContextFormSerializer doesn't use contextualize #310

Open
brunobord opened this issue Mar 6, 2018 · 0 comments
Open

ContextFormSerializer doesn't use contextualize #310

brunobord opened this issue Mar 6, 2018 · 0 comments

Comments

@brunobord
Copy link
Contributor

The ContextFormSerializer view returns a contextualized form using the DRF serializers & such.
On the other hand, the contextualize function returns a contextualized form that analyses the fields and the conditions, etc.

They DON'T return the same result, which is misleading, because we would expect them to work the same way, and the integrator wouldn't understand why the "ValidateViewFromSchema" is using a difference schema for validation... BTW, this view is the only location where the contextualize function is called.

refs:

We need to standardize this: I understand that the implementation using DRF Serializers would return less items from the DB, because they filter out the unneeded fields, etc ; but on the other hand, the contextualize function is far easier to read, and it looks like it's a naive but efficient implementation of contextualization decorrelated from the actual model implementation. If some day, we switch to a simple key/JSON value storage, we won't have to reimplement contextualization, the function won't change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant