from django.core.management.base import NoArgsCommand
from api.models import Order
from django.db import transaction
from api.manager import order_manager

order_list = [
]

class Command(NoArgsCommand):

    def handle(self, *args, **options):
        for one_order in order_list:

            with transaction.atomic():
                order = Order.objects.select_for_update().get(pk=one_order)
                print 'order %s , status : %s ... ' % (str(one_order), str(order.status))
                order_manager.refund_can_not_refundorder(order)
                print 'order ok %s ..' % one_order