Hi,
I'm not sure if it is meant to be used, but the only way I have found to select certain fields of a model in query is to use .only(field_list)
e.g. model.objects.filter().only(field_list).all()
It seems to work, except I encountered a strange issue when filtering on a table with a partition key and two clustering key:
My specific case was similar to this one:
e.g. model.objects.filter(id__in=ids, other_text_field=some_string, start_date__gte=first_date, start_date__lt=end_date).only(field_list).all()
where "id" is partition key, and other_text_field and start_date and clustering keys in that specific order.
For some reason, in that case, all fields will be returned, not just those in field_list.
However, if I create a table with no "other_text_field" and do not filter with it, the query is made with the fields in field_list.
I'm curious about the intent behind only() and if there is a way to make the driver more verbose as to what could've caused this behavior.
Thank you.