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

from doctor.models import Bulletin, BulletinExtra


class Command(BaseCommand):
    """
    公告写入
    python manage.py bulletin_write
    """

    def handle(self, *args, **options):
        bulletins = Bulletin.objects.all()
        for bulletin in bulletins:
            if not BulletinExtra.objects.filter(bulletin_id=bulletin.id):
                BulletinExtra.objects.create(bulletin_id=bulletin.id, area='1')