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

from api.models import Area


class Command(BaseCommand):

    @classmethod
    def _save_data(cls, name, num):
        a = Area(area_name=name, phone_prefix=num)
        a.save()

    def handle(self, *args, **kwargs):
        self._save_data(u'中国大陆', u'+86')
        self._save_data(u'香港', u'+852')
        self._save_data(u'台湾', u'+886')
        self._save_data(u'韩国', u'+82')
        self._save_data(u'日本', u'+81')