コード例 #1
0
ファイル: merge_people.py プロジェクト: wyrmiyu/kompassi
    def handle(*args, **opts):
        args = args[1:]

        people_to_merge = Person.objects.filter(pk__in=[int(i) for i in args])
        person_to_spare = Person.objects.get(pk=opts['into'])
        print 'merging', people_to_merge, 'into', person_to_spare
        merge_people(people_to_merge, into=person_to_spare)
コード例 #2
0
ファイル: admin.py プロジェクト: tracon/kompassi
def merge_selected_people(modeladmin, request, queryset):
    if queryset.count() < 2:
        return

    from core.merge_people import find_best_candidate, merge_people

    person_to_spare, people_to_merge = find_best_candidate(queryset)
    merge_people(people_to_merge, into=person_to_spare)
コード例 #3
0
def merge_selected_people(modeladmin, request, queryset):
    if queryset.count() < 2:
        return

    from core.merge_people import find_best_candidate, merge_people

    person_to_spare, people_to_merge = find_best_candidate(queryset)
    merge_people(people_to_merge, into=person_to_spare)
コード例 #4
0
ファイル: automerge_people.py プロジェクト: Hilzu/kompassi
    def handle(*args, **opts):
        for email in Person.objects.all().values_list('email', flat=True).distinct():
            if not email:
                continue

            people = Person.objects.filter(email=email)
            if people.count() > 1:
                print email
                for person_to_spare, people_to_merge in possible_merges(people):
                    merge_people(people_to_merge, into=person_to_spare)
コード例 #5
0
ファイル: automerge_people.py プロジェクト: wizzu/kompassi
    def handle(*args, **opts):
        for email in Person.objects.all().values_list('email',
                                                      flat=True).distinct():
            if not email:
                continue

            people = Person.objects.filter(email=email)
            if people.count() > 1:
                print(email)
                for person_to_spare, people_to_merge in possible_merges(
                        people):
                    merge_people(people_to_merge, into=person_to_spare)