comses / comses.net

comses.net wagtail site
https://www.comses.net
GNU General Public License v3.0
17 stars 16 forks source link

Accepted Media Type and Renderers #345

Open cpritcha opened 6 years ago

cpritcha commented 6 years ago

Our serializers are using rest framework serializers right now to render our viewset html templates. This has made additional work (creating related serializers to avoid serializing too much data and conditionally serializing data based on permissions). It would be better if we moved over to directly sending python objects (such as model instances, enums and querysets) directly to the TemplateHTMLRenderer. See http://www.django-rest-framework.org/api-guide/renderers/#varying-behaviour-by-media-type for an example. That would remove the need for related serializers, url calls (could use get_absolute_url calls instead) and remove the need to more serializers more complicated to accommodate permissions.

cpritcha commented 6 years ago

We should be able to get rid of our custom pagination class (SmallResultSetPagination) once this change is complete as well.