Exemplo n.º 1
0
    def get_files(self, project):
        from scanpipe.api.serializers import CodebaseResourceSerializer

        resources = project.codebaseresources.without_symlinks()

        for obj in resources.iterator():
            yield self.encode(CodebaseResourceSerializer(obj).data)
Exemplo n.º 2
0
    def resources(self, request, *args, **kwargs):
        project = self.get_object()
        queryset = CodebaseResource.objects.project(project).prefetch_related(
            "discovered_packages")

        paginated_qs = self.paginate_queryset(queryset)
        serializer = CodebaseResourceSerializer(paginated_qs, many=True)

        return Response(serializer.data)
Exemplo n.º 3
0
    def get_files(self, project):
        resources = project.codebaseresources.without_symlinks()

        for obj in resources.iterator():
            yield self.encode(CodebaseResourceSerializer(obj).data)