006181e72a517705f690e188238c644476932dba,app/server/api.py,ProjectViewSet,progress,#ProjectViewSet#Any#Any#,30

Before Change


    def progress(self, request, pk=None):
        project = self.get_object()
        docs = project.get_documents(is_null=True)
        total = project.documents.count()
        remaining = docs.count()

        return Response({"total": total, "remaining": remaining})


class ProjectLabelsAPI(generics.ListCreateAPIView):
    queryset = Label.objects.all()

After Change


    @action(methods=["get"], detail=True)
    def progress(self, request, pk=None):
        project = self.get_object()
        return Response(project.get_progress())


class ProjectLabelsAPI(generics.ListCreateAPIView):
    queryset = Label.objects.all()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: chakki-works/doccano
Commit Name: 006181e72a517705f690e188238c644476932dba
Time: 2018-08-08
Author: light.tree.1.13@gmail.com
File Name: app/server/api.py
Class Name: ProjectViewSet
Method Name: progress


Project Name: comic/grand-challenge.org
Commit Name: 05a86908b5d9b1c90b7f605ce42827ace81b7445
Time: 2020-01-17
Author: haimasree.diag@gmail.com
File Name: app/grandchallenge/cases/views.py
Class Name: RawImageUploadSessionViewSet
Method Name: process_images


Project Name: AlexsLemonade/refinebio
Commit Name: 90e5fffcd65a786b8344d46246f31f14ecc98dbe
Time: 2018-07-02
Author: willvauclain.dev@gmail.com
File Name: api/data_refinery_api/views.py
Class Name: TranscriptomeIndexDetail
Method Name: get