def get_process_single(self, id):
#####
# Retrieves a single object
#####
try:
clean_id = int(id)
except:
return status.HTTP_400_BAD_REQUEST
try:
object = self.Meta.Model.objects.get(id=clean_id)
except ObjectDoesNotExist:
return status.HTTP_404_NOT_FOUND
self.setResult(object.get_as_dict())
return status.HTTP_200_OK
评论列表
文章目录