#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
#   Author  :   RobertDing
#   E-mail  :   robertdingx@gmail.com
#   Date    :   16/03/16 18:49:03
#   Desc    :   把 api_recommend_doctor 表的数据整合到 api_stock_alert
#

from django.core.management import BaseCommand

from api.models.recommend_doctor import RecommendDoctor, StockAlert


class Command(BaseCommand):

    def handle(self, *args, **kwargs):
        for x in RecommendDoctor.objects.all():
            StockAlert.insert(x)
        else:
            print('数据更新完毕')
