joshourisman / django-tablib

django-tablib is a helper library for Django that allows Django models to be used to generate tablib datasets with introspection of the fields on the models if no headers are provided. If headers are provided they can reference any attribute, fields, properties, or methods on the model.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extra fields not exported

dyve opened this issue · comments

If you add extra fields to a queryset using .extra(select={'foo': '...'}), these are not exported if you send the queryset to django-tablib. It looks like tablib does not 'see' the extra fiedls, only the model fields.

ModelDatasets work based on the model definitions, and determine the list of fields based on that. Any content from .extra() is not part of the model definition, and so ModelDatasets don't know about it.