Exemplo n.º 1
0
 def get_object(self, pk):
     try:
         return self.model_name.objects.get(pk=pk)
     except self.model_name.DoesNotExist:
         raise CustomNotFound(DETAILS_NOT_FOUND)
Exemplo n.º 2
0
 def get_sub_task(self, pk):
     try:
         return self.sub_task_model_name.objects.get(task=pk)
     except self.sub_task_model_name.DoesNotExist:
         raise CustomNotFound(DETAILS_NOT_FOUND)