def change_instructor_badge_to_swc_instructor(apps, schemat_editor):
    Badge = apps.get_model('workshops', 'Badge')

    # it may not exist, for example in tests
    instructor, _ = Badge.objects.get_or_create(name='instructor')
    # new attributes:
    instructor.name = 'swc-instructor'
    instructor.title = 'Software Carpentry Instructor'
    instructor.criteria = 'Teaching at Software Carpentry workshops or online'
    instructor.save()
Get 'Instructor' badge, change it to 'Software Carpentry Instructor'.
dataset/ETHPy150Open swcarpentry/amy/workshops/migrations/0064_dc_instructor_badge.py/change_instructor_badge_to_swc_instructor