comses.net icon indicating copy to clipboard operation
comses.net copied to clipboard

Accepted Media Type and Renderers

Open cpritcha opened this issue 7 years ago • 1 comments

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 avatar May 16 '18 17:05 cpritcha

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

cpritcha avatar May 16 '18 23:05 cpritcha