You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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:
ContextFormSerializer
: https://github.com/peopledoc/django-formidable/blob/master/formidable/serializers/forms.py#L135-L147contextualize
: https://github.com/peopledoc/django-formidable/blob/master/formidable/serializers/forms.py#L201-L209ValidateViewFromSchema
: https://github.com/peopledoc/django-formidable/blob/master/formidable/views.py#L323We 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.The text was updated successfully, but these errors were encountered: