Ejemplo n.º 1
0
 def subprojects(self, request, **kwargs):
     project = get_object_or_404(Project.objects.api(self.request.user),
                                 pk=kwargs['pk'])
     rels = project.subprojects.all()
     children = [rel.child for rel in rels]
     return Response(
         {'subprojects': ProjectSerializer(children, many=True).data})
Ejemplo n.º 2
0
 def translations(self, request, **kwargs):
     project = get_object_or_404(Project.objects.api(self.request.user),
                                 pk=kwargs['pk'])
     queryset = project.translations.all()
     return Response(
         {'translations': ProjectSerializer(queryset, many=True).data})
Ejemplo n.º 3
0
 def translations(self, request, pk):
     translations = self.get_object().translations.all()
     return Response({
         'translations': ProjectSerializer(translations, many=True).data
     })