Private
Public Access
1
0

verbose names for boat class

This commit is contained in:
Sander Roosendaal
2020-05-28 07:56:48 +02:00
parent 1c9d45a026
commit a6e5a0588a
2 changed files with 15 additions and 2 deletions

View File

@@ -59,7 +59,7 @@
<td>{{ standard.name }}</td>
<td>{{ standard.coursedistance }}</td>
<td>{{ standard.coursetime }}</td>
<td>{{ standard.boatclass }}</td>
<td>{{ standard.boatclass|boatclass }}</td>
<td>{{ standard.boattype }}</td>
<td>{{ standard.sex|sex }}</td>
<td>{{ standard.weightclass|weight }}</td>

View File

@@ -22,7 +22,9 @@ from rowers import c2stuff, runkeeperstuff
from rowers.c2stuff import c2_open
from rowers.runkeeperstuff import runkeeper_open
from rowers.rower_rules import is_coach_user, is_workout_user, isplanmember,ispromember
from rowers.mytypes import otwtypes,adaptivetypes,sexcategories,weightcategories
from rowers.mytypes import (
otwtypes,adaptivetypes,sexcategories,weightcategories,workouttypes,
)
from rowers.utils import NoTokenError
import rowers.payments as payments
@@ -49,6 +51,17 @@ def adaptive(s):
return u
@register.filter
def boatclass(s):
u = s
for e,v in workouttypes:
if e.lower() == u.lower():
u = v
continue
return u
@register.filter
def sex(s):
u = s