Beispiel #1
0
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()
Beispiel #2
0
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()
Beispiel #3
0
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()
Beispiel #4
0
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()