def start_registration(): from auction.models import Auction auctions = Auction.objects.filter(state=Auction.WAIT, start_registration_at__lte=utc_time(datetime.now()), magazine_scan__isnull=False).all() for auction in auctions: auction.start_registration()
def finish_auctions(): from auction.models import Auction auctions = Auction.objects.filter(state=Auction.ACTIVE, finish_at__lte=utc_time(datetime.now())).all() for auction in auctions: auction.make_magic() auction.finish()
def start_auction(): from auction.models import Auction auctions = Auction.objects.filter(state=Auction.REG_FINISH, start_at__lte=utc_time(datetime.now())).all() for auction in auctions: if auction.traders_count <= len(auction.users): auction.start() else: auction.not_behavior()
def finish_registration(): from auction.models import Auction auctions = Auction.objects.filter(state=Auction.REG_STARTED, finish_registration_at__lte=utc_time(datetime.now())).all() for auction in auctions: auction.finish_registration()