from festival.models import Participant, Meeting
from itfprofiles.models import Person

def migrate_participants():
    for p in Participant.objects.all():
        name = p.name
        names = name.split(" ")
        person = Person()
        if len(names) > 1:
            person.last_name = names[-1]
            person.first_name = " ".join(names[0:-1])
        else:
            person.first_name = names[0]
        person.about = p.short_bio
        person.save()
        print "saved %s %s" % (person.first_name, person.last_name,)
        
