Add club to output

This commit is contained in:
Christian Wolf 2024-03-14 13:08:27 +01:00
parent 5c4b0106fc
commit 7ec359d2f2
6 changed files with 18 additions and 4 deletions

View File

@ -126,7 +126,12 @@ class ConsoleOutputter(AbstractOutputter):
return "\n".join(lines)
mappedResults = map(mapResultColumn, results)
tableRow = [f"{participant.name} ({participant.id})"] + list(mappedResults)
participantName = f'{participant.name} ({participant.id})'
if participant.club is not None:
participantName = f'{participantName}, {participant.club}'
tableRow = [f"{participantName}"] + list(mappedResults)
tableData.append(tableRow)
self.l.log(5, "table data: %s", pprint.pformat(tableData))

View File

@ -21,6 +21,7 @@
<table class="tab-summary">
<tr>
<th>Teilnehmer</th>
<th>Verein</th>
{% for dance in data.resultsPerGroup[group].dances %}
<th>{{ dance }}</th>
{% endfor %}
@ -35,6 +36,11 @@
{% if participant.finalist or not onlyFinalists %}
<tr class="{{ rowCls }}">
<td>{{ participant.name }} ({{ participant.id }})</td>
<td>
{% if participant.club is not none %}
{{ participant.club}}
{% endif %}
</td>
{% for dance in data.resultsPerGroup[group].dances %}
{% block danceResult scoped %}
{% set res = activeGroup[participant][loop.index0] %}

View File

@ -2,10 +2,11 @@ from .place import Place
class HtmlSingleCompetitionResult:
def __init__(self, name: str, place: Place, finalist: bool):
def __init__(self, name: str, place: Place, finalist: bool, club: str):
self.name = name
self.place = place
self.finalist = finalist
self.club = club
def __repr__(self):
place = self.place

View File

@ -9,10 +9,12 @@ class Participant(Person):
name: str,
id: int,
finalist: bool = None,
club: str = None,
):
super().__init__(name)
self.id = id
self.finalist = finalist
self.club = club
def __repr__(self):
if self.finalist == True:

View File

@ -85,7 +85,7 @@ class ResultExtractor:
placeStr = result.results[person]
place = self._extractPlace(placeStr)
competitionResult = types.HtmlSingleCompetitionResult(
person.name, place, person.finalist
person.name, place, person.finalist, person.club
)
results.add(
competitionGroup,

View File

@ -329,7 +329,7 @@ class Worker:
if id not in mapping:
mapping[id] = solo_turnier.types.Participant(
name=results[0].name, id=id
name=results[0].name, id=id, club=results[0].club
)
else:
if mapping[id].name != results[0].name or mapping[id].id != id: