django-rest-framework-datatables
django-rest-framework-datatables copied to clipboard
unused fields filtering removing nested fields
_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
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 ?
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')