Exemplo n.º 1
0
    def today(self):
        fdate = parse_date(date=self.date, localize=False).date()

        if fdate == today() and not self.period == 'Postponed':
            return True

        return False
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
  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
Exemplo n.º 5
0
    def today(self):
        fdate = parse_date(date=self.date, localize=False).date()
        fdate = fdate == today() and self.period != 'Postponed'

        return fdate
Exemplo n.º 6
0
    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