def get_or_create(cls, session, siteTourneyNo, tourneyTypeId): """Fetch tourney by index or creates one if none. """ return get_or_create( cls, session, siteTourneyNo=siteTourneyNo, tourneyTypeId=tourneyTypeId)[0]
def get_or_create(session, siteId, gametype): map = zip([ 'type', 'base', 'category', 'limitType', 'smallBlind', 'bigBlind', 'smallBet', 'bigBet' ], [ 'type', 'base', 'category', 'limitType', 'sb', 'bb', 'dummy', 'dummy', ]) gametype = dict([(new, gametype.get(old)) for new, old in map]) hilo = "h" if gametype['category'] in ('studhilo', 'omahahilo'): hilo = "s" elif gametype['category'] in ('razz', '27_3draw', 'badugi'): hilo = "l" gametype['hiLo'] = hilo for f in ['smallBlind', 'bigBlind', 'smallBet', 'bigBet']: if gametype[f] is None: gametype[f] = 0 gametype[f] = int(Decimal(gametype[f]) * 100) gametype['siteId'] = siteId return get_or_create(Gametype, session, **gametype)[0]
def get_or_create(cls, session, **kwargs): """Fetch tourney type by index or creates one if none Required kwargs: buyin fee speed maxSeats knockout rebuyOrAddon headsUp shootout matrix sng """ return get_or_create(cls, session, **kwargs)[0]
def get_or_create(cls, session, **kwargs): """Fetch tourney type by index or creates one if none Required kwargs: buyin fee speed maxSeats knockout rebuy addOn shootout matrix sng currency """ return get_or_create(cls, session, **kwargs)[0]
def get_or_create(session, siteId, gametype): map = zip( ['type', 'base', 'category', 'limitType', 'smallBlind', 'bigBlind', 'smallBet', 'bigBet', 'currency'], ['type', 'base', 'category', 'limitType', 'sb', 'bb', 'dummy', 'dummy', 'currency']) gametype = dict([(new, gametype.get(old)) for new, old in map ]) hilo = "h" if gametype['category'] in ('studhilo', 'omahahilo'): hilo = "s" elif gametype['category'] in ('razz','27_3draw','badugi'): hilo = "l" gametype['hiLo'] = hilo for f in ['smallBlind', 'bigBlind', 'smallBet', 'bigBet']: if gametype[f] is None: gametype[f] = 0 gametype[f] = int(Decimal(gametype[f])*100) gametype['siteId'] = siteId return get_or_create(Gametype, session, **gametype)[0]
def get_or_create(cls, session, tourneyId, playerId): """Fetch tourney player by index or creates one if none """ return get_or_create(cls, session, tourneyId=tourneyId, playerId=playerId)
def get_or_create(session, siteId, name): return get_or_create(Player, session, siteId=siteId, name=name)[0]
def get_or_create(cls, session, siteTourneyNo, tourneyTypeId): """Fetch tourney by index or creates one if none. """ return get_or_create(cls, session, siteTourneyNo=siteTourneyNo, tourneyTypeId=tourneyTypeId)[0]