I am trying to serialize a queryset into json using my custom iterator. On the models I detect the fields in the model and insert them into the JSON dict as I need them.
I am having trouble figuring out how to determine which fields have been deferred in the model using the defer or only queryset function.
Is there a way, and how, to find out which fields are deferred and how to skip over them?
Somewhat buried…
queryset.query.get_loaded_field_names()