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

unused fields filtering removing nested fields #14

Open
jerzyk opened this issue May 31, 2018 · 2 comments
Open

unused fields filtering removing nested fields #14

jerzyk opened this issue May 31, 2018 · 2 comments

Comments

@jerzyk
Copy link
Contributor

jerzyk commented May 31, 2018

_filter_unused_fields is building list of columns from request, lets assume that there is a field detail.name which is perfectly fine and properly serialized

in the next loop there is a list of keys build in the loop for each record, but this list contains only detail key which is not on the previously built list of columns - in this moment data dissapears from the response... of course, there is an option to keep data despite missing key (datatables_always_serialize list) - but in my opinion for the nested fields default approach should be to keep them without additional hassle

@izimobil
Copy link
Owner

Hi,
Could you provide sample code so I can reproduce/understand better the issue, also, can you test this issue with version 0.4.0, does it fixes the issue ?

@jerzyk
Copy link
Contributor Author

jerzyk commented Jun 22, 2018

sorry, I have right now a lot of work in different project, so writing from memory to not keep you waiting

model Detail(model)
name = CharField()

model Master(model):
code
provides = FK(Detail)

in MasterSerializer:
detail_name = charfield(source='detail.name')

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

2 participants