a460674c772c2c0685148c8eb94b1743afea71d5,jarbas/dashboard/admin.py,ReimbursementModelAdmin,get_search_results,#ReimbursementModelAdmin#Any#Any#Any#,372

Before Change


        return super().formfield_for_dbfield(db_field, **kwargs)

    def get_search_results(self, request, queryset, search_term):
        if not search_term:
            return super(ReimbursementModelAdmin, self) \
                .get_search_results(request, queryset, search_term)

        query = SearchQuery(search_term, config="portuguese")
        rank = SearchRank(F("search_vector"), query)
        queryset = Reimbursement.objects.annotate(rank=rank) \
            .filter(search_vector=query) \

After Change


        if search_term:
            query = SearchQuery(search_term, config="portuguese")
            rank = SearchRank(F("search_vector"), query)
            queryset = queryset.annotate(rank=rank) \
                .filter(search_vector=query) \
                .order_by("-rank")

        return queryset, distinct

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: okfn-brasil/serenata-de-amor
Commit Name: a460674c772c2c0685148c8eb94b1743afea71d5
Time: 2017-09-28
Author: cuducos@users.noreply.github.com
File Name: jarbas/dashboard/admin.py
Class Name: ReimbursementModelAdmin
Method Name: get_search_results


Project Name: MTG/freesound
Commit Name: c5227861460b2b937266ccafff76f2731265c424
Time: 2017-11-10
Author: alastair.porter@upf.edu
File Name: forum/models.py
Class Name: Thread
Method Name: set_last_post


Project Name: MTG/freesound
Commit Name: ad58b661aaee955bf8dc8086d805d56485f8c53a
Time: 2019-07-24
Author: alastair.porter@upf.edu
File Name: sounds/views.py
Class Name:
Method Name: sounds