azavea/django-queryset-csv — pull request #61 by nshafer (2014-10-14 22:54:28+00:00)
Title: Added support for aggregated fields in CSV output.

If you have an aggregated field in your queryset, such as with:

```
Publisher.objects.annotate(num_books=Count('book'))
```

Trying to include this column 'num_books' in your CSV output results in a ValueError Exception with the error `dict contains fields not in fieldnames: num_dispensaries`. This fixes that by looking for column names for aggregates in the queryset.query, just like for extra columns.