I added in the ability to sort comments and replies by datetime_created through using rest_framework.filters.OrderingFilter and overriding the filter_backends property of both CommentViewSet and ReplyViewSet. These filters can be used by adding in the query parameter ordering=datetime_created for descending order and ordering=-datetime_created for ascending order. Note the only distinction between descending and ascending order is the minus sign used.
I added in the ability to sort comments and replies by
datetime_created
through usingrest_framework.filters.OrderingFilter
and overriding thefilter_backends
property of bothCommentViewSet
andReplyViewSet
. These filters can be used by adding in the query parameterordering=datetime_created
for descending order andordering=-datetime_created
for ascending order. Note the only distinction between descending and ascending order is the minus sign used.