Finished templates for new HTTP method
This commit is contained in:
@@ -42,10 +42,16 @@ class Team(models.Model):
|
||||
name = models.CharField(max_length=200)
|
||||
icon = models.FileField(upload_to="images/team_logos/")
|
||||
abbr = models.CharField(max_length=3)
|
||||
iconURL = models.CharField(max_length=2000)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
class Meta:
|
||||
managed = True
|
||||
app_label = 'tipp'
|
||||
|
||||
|
||||
class Match(models.Model):
|
||||
matchID = models.IntegerField(unique=True,primary_key=True)
|
||||
matchDateTime = models.DateTimeField()
|
||||
|
||||
@@ -141,10 +141,12 @@ def getSeason(request, ls, season):
|
||||
for team in teams[0]:
|
||||
t = Team(
|
||||
teamID=team['teamID'],
|
||||
name=team['teamName']
|
||||
name=team['teamName'],
|
||||
iconURL = team['teamIconURL']
|
||||
)
|
||||
t.save()
|
||||
|
||||
|
||||
for match in season[0]:
|
||||
m = Match(matchID=unicode(match['matchID']),
|
||||
matchDateTime=datetime.strptime(unicode(match['matchDateTime']), '%Y-%m-%d %H:%M:%S'),
|
||||
@@ -339,9 +341,11 @@ def matchday(request, ls, season, matchday, template_name='md.html'):
|
||||
item['matchDateTime'] = (match.matchDateTime.astimezone(timezoneLocal).strftime('%a %d.%m, %H:%M'))
|
||||
|
||||
item['iconTeam1']= str(match.idTeam1.icon)
|
||||
item['iconURLTeam1'] = str(match.idTeam1.iconURL)
|
||||
item['nameTeam1']= str(match.idTeam1)
|
||||
item['abbrTeam1']= str(match.idTeam1.abbr)
|
||||
item['iconTeam2'] = str(match.idTeam2.icon)
|
||||
item['iconURLTeam2'] = str(match.idTeam2.iconURL)
|
||||
item['nameTeam2'] = str(match.idTeam2)
|
||||
item['abbrTeam2']= str(match.idTeam2.abbr)
|
||||
item['started'] = match_started
|
||||
|
||||
Reference in New Issue
Block a user