Esempio n. 1
0
    def init_team(self, team):
        """Create team if not exists."""

        team_stored = Team.all().filter('name =', team['name']).get()
        if team_stored is None:
            team_stored = Team(name=team['name'])
            short_match = re.search(r'([a-z]{3})\.gif$', team['flag'])
            team_stored.flag = team['flag']
            team_stored.short = short_match.group(1)
            team_stored.href = team['href']
            team_stored.put()

        return team_stored
Esempio n. 2
0
    def init_team(self, team):
        """Create team if not exists."""

        team_stored = Team.all().filter('name =',team['name']).get()
        if team_stored is None:
            team_stored = Team(name=team['name'])
            short_match = re.search(r'([a-z]{3})\.gif$',team['flag'])
            team_stored.flag = team['flag']
            team_stored.short = short_match.group(1)
            team_stored.href = team['href']
            team_stored.put()

        return team_stored
Esempio n. 3
0
    def init_team(self, team):
        """Create team if not exists."""

        team_stored = Team.all().filter('name =',team['name']).get()
        if team_stored is None:
            team_stored = Team(name=team['name'])
            short_match = re.search(r'([a-z]{3})\.png$',team['flag'])
            team_stored.flag = team['flag']
            team_stored.short = short_match.group(1)
            team_stored.href = "http://www.uefa.com/" + team['href']
            team_stored.teamId = re.match(r'/uefaeuro/season=2012/teams/team=([0-9]+)/index.html', team['href']).group(1)
            team_stored.put()

        return team_stored
Esempio n. 4
0
    def init_team(self, team):
        """Create team if not exists."""

        team_stored = Team.all().filter('name =', team['name']).get()
        if team_stored is None:
            team_stored = Team(name=team['name'])
            short_match = re.search(r'([a-z]{3})\.png$', team['flag'])
            team_stored.flag = team['flag']
            team_stored.short = short_match.group(1)
            team_stored.href = "http://www.uefa.com/" + team['href']
            team_stored.teamId = re.match(
                r'/uefaeuro/season=2012/teams/team=([0-9]+)/index.html',
                team['href']).group(1)
            team_stored.put()

        return team_stored