e9a52a115be4970db2abdeb921ca0a790ed30809,app/server/views.py,ProjectDocsAPI,get_queryset,#ProjectDocsAPI#,156

Before Change


        isnull = self.request.query_params.get("is_checked") == "true"
        if project.is_type_of(Project.DOCUMENT_CLASSIFICATION):
            queryset = queryset.filter(doc_annotations__isnull=isnull).distinct()
        elif project.is_type_of(Project.SEQUENCE_LABELING):
            queryset = queryset.filter(seq_annotations__isnull=isnull).distinct()
        elif project.is_type_of(Project.Seq2seq):
            queryset = queryset.filter(seq2seq_annotations__isnull=isnull).distinct()

After Change



        project = get_object_or_404(Project, pk=project_id)
        is_null = self.request.query_params.get("is_checked") == "true"
        queryset = Factory.get_documents(project, is_null).distinct()

        return queryset

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: chakki-works/doccano
Commit Name: e9a52a115be4970db2abdeb921ca0a790ed30809
Time: 2018-07-26
Author: hiroki.nakayama.py@gmail.com
File Name: app/server/views.py
Class Name: ProjectDocsAPI
Method Name: get_queryset


Project Name: chakki-works/doccano
Commit Name: 7406183a0c7ca72f202a0e8b6f132e90bdbf21c7
Time: 2018-08-02
Author: hiroki.nakayama.py@gmail.com
File Name: app/server/views.py
Class Name: DataDownloadAPI
Method Name: get


Project Name: chakki-works/doccano
Commit Name: e9a52a115be4970db2abdeb921ca0a790ed30809
Time: 2018-07-26
Author: hiroki.nakayama.py@gmail.com
File Name: app/server/views.py
Class Name: ProjectViewSet
Method Name: progress