# coding=utf-8

from django.core.management import BaseCommand
from api.models import BuDanRealtedOrder
from django.db.models import Q


class Command(BaseCommand):
    """
    python manage.py update_20190610_budan_related_orders
    315834285769
    """

    def handle(self, *args, **options):
        budan_id = '315834285769'
        BuDanRealtedOrder.objects.filter(budan_id=budan_id).update(is_delete=True)
        BuDanRealtedOrder.objects.filter(~Q(budan_id=budan_id)).update(is_delete=False)
        print 'DONE!'


