djaodjin / djaodjin-saas

Django application for software-as-service and subscription businesses
Other
564 stars 124 forks source link

Refactor download views #41

Closed rene-armida closed 9 years ago

rene-armida commented 9 years ago

We have added a number of CSV download views recently. These integrate with the django_rest_framework via SmartListMixin, which provides filtering. All of our download views should be refactored as follows:

  1. extract the CSV generation code into an abstract parent class, e.g. CSVDownloadView. This would inherit from View.
  2. extract the queryset fetching into a mixin with a get_queryset method.
  3. each concrete download view inherits from the above mixin and the download view.