# coding=utf-8
from django.core.management import BaseCommand

from api.models import Doctor, Person

class Command(BaseCommand):

    def handle(self, *args, **options):
        doctors = Doctor.objects.all()
        for doctor in doctors:
            user = doctor.user
            if user is not None:
                person = Person.get_or_create(user)
                print person