Closed estebistec closed 10 years ago
In the original ListOrItemField.from_native
, data
is being passed through if there is no item field and the data is a single value. This is no longer the case with ListOrItemField.field_from_native
, and the original data is lost in the process. Maybe we should be calling super for that case?
I believe this is all of the changes I'm going to make here, and that it fixes #18 as well. I'll give this another day and if you hear no objections I'll merge it down. I'm feeling like the fields are much better normalized on the intended uses for validate
and run_validators
.
Do you know if the tests from https://github.com/estebistec/drf-compound-fields/pull/18 pass when using this branch?
We should probably migrate them over if they do, so we don't need to worry about regressions.
yes, I added all three of those tests to this branch already.
will be merging and releasing a version in a short while
Merged locally with a rebase. GitHub would probably show it if I pushed the rebase, but I'm not a fan of re-writing shared branched. Closing.
Fixed released in 0.2.2: https://pypi.python.org/pypi/drf-compound-fields/0.2.2
This is a proposed fix for the issue reported in #15.
In ListOrItemField, implement initialize and field_from_native to ensure embedded serializers are validated