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

from api.models import VideoWhiteList


class Command(BaseCommand):
    """
    批量修改秒杀美购的更美价和秒杀价 python manage.py add_service_price_discount update(大促专用加)
    """

    def handle(self, *args, **options):
        file = open('video_white_list.txt')
        lines = file.readlines()
        for line in lines:
            print line
            try:
                VideoWhiteList.objects.get_or_create(user_id=line)
            except:
                print('error:' + line)
                continue
            print('success:' + line)
