def today(self): fdate = parse_date(date=self.date, localize=False).date() if fdate == today() and not self.period == 'Postponed': return True return False
def fx_query(self): first = Fixture.select().where(Fixture.date >= today()).order_by( Fixture.date).limit(1) odate = now() if not first else first[0].date limit = query_date_range({'days': 21}, odate) query = (Fixture.date > limit[0]) & (Fixture.date < limit[1]) return query
def live(self): fdate = parse_date(date=self.date, localize=False).date() if fdate == today() and self.period not in [ 'PreMatch', 'FullTime', 'Postponed' ]: return True return False
def get_matchdays(self, comp_ids=None): kwargs = { 'base_url': self.score_url, 'url': 'en/search/matchdays', 'key': ['data', 'matchdays'], 'cache_key': 'competitions', 'ttl': 60, 'params': { 'competitions': comp_ids, 'since': today('%Y-%m-%d'), 'utc_offset': tzone('%z') } } response = self.get(**kwargs) combined = [] for item in response: for group in item['groups']: combined = combined + group['matches'] return combined
def today(self): fdate = parse_date(date=self.date, localize=False).date() fdate = fdate == today() and self.period != 'Postponed' return fdate
def live(self): pastp = ['PreMatch', 'FullTime', 'Postponed'] fdate = parse_date(date=self.date, localize=False).date() fdate = fdate == today() and self.period not in pastp return fdate