Add finalist attribute to objects
This commit is contained in:
parent
26d37a7237
commit
4275466cca
@ -44,7 +44,8 @@ def test_extractCompetitionFromRow():
|
|||||||
'group': 'Kin',
|
'group': 'Kin',
|
||||||
'place': '2',
|
'place': '2',
|
||||||
'placeTo': '2',
|
'placeTo': '2',
|
||||||
'id': 2
|
'id': 2,
|
||||||
|
'finalist': None
|
||||||
}
|
}
|
||||||
assert person.__dict__ == expected
|
assert person.__dict__ == expected
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ class CompetitionResult:
|
|||||||
self.place = place
|
self.place = place
|
||||||
self.placeTo = placeTo
|
self.placeTo = placeTo
|
||||||
self.id = int(id)
|
self.id = int(id)
|
||||||
|
self.finalist = None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def extractFromResultRow(row: ResultRow):
|
def extractFromResultRow(row: ResultRow):
|
||||||
@ -75,7 +76,12 @@ class CompetitionResult:
|
|||||||
result = f'{self.place}.'
|
result = f'{self.place}.'
|
||||||
else:
|
else:
|
||||||
result = f'{self.place}.-{self.placeTo}.'
|
result = f'{self.place}.-{self.placeTo}.'
|
||||||
return f'Result[{self.id}]({self.group} {self.class_} {self.dance} as {result})'
|
|
||||||
|
if self.finalist == True:
|
||||||
|
finalist = '[F]'
|
||||||
|
else:
|
||||||
|
finalist = ''
|
||||||
|
return f'Result[{self.id}]({self.group} {self.class_} {self.dance} as {result}{finalist})'
|
||||||
|
|
||||||
def __eq__(self, o):
|
def __eq__(self, o):
|
||||||
if not isinstance(o, CompetitionResult):
|
if not isinstance(o, CompetitionResult):
|
||||||
|
Loading…
Reference in New Issue
Block a user