Building a query set from a Model we run into problems if we want to use .values_list to avoid creating objects on the results with a model that has a db_field defined.
An example model:
Then later we wish to query this but get back the results efficiently:
This throws an exception like the following, and changing to the original table field name doesn't work out because it's hard dependent on the attribute present in the Model:
Thanks for the report, this looks like a bug. It seems internally in some places of the code the correct mapping between db_field and the columns name is not done properly. I've pushed a potential solution and added the script as a test.