Second team gets details of the first team.
I don't know if this is the result of this library or a problem with chpp in general. But I'm starting here.
When doing the following:
chpp = CHPP(consumer_key,
consumer_secret,
access_key,
access_secret)
current_user = chpp.user()
all_teams = current_user._teams_ht_id
for teamid in all_teams:
print(teamid)
this_team = chpp.team(ht_id=teamid)
pprint(vars(this_team))
The expected output would be a printout of both my teams. However, it's not really doing that, this is the printout (shortened):
9838
{'_REQUEST_ARGS': {'teamID': 9838},
'_chpp': <pychpp.chpp.CHPP object at 0x7fefb03853a0>,
'_data': <Element 'HattrickData' at 0x7fefb074ff90>,
'arena_ht_id': 9838,
'arena_name': 'Nyvångsskolans idrottsfält',
...
'name': 'Dalby Stenbrotters FC',
...
'user_ht_id': 182085,
'user_icq': 'None',
'user_last_login_date': datetime.datetime(2020, 6, 21, 6, 32, 56),
'user_login': 'Kvarak',
'user_signup_date': datetime.datetime(2012, 3, 8, 6, 36, 48),
'youth_team_ht_id': 2827420,
'youth_team_name': 'Möllan BK'}
44307
{'_REQUEST_ARGS': {'teamID': 44307},
'_chpp': <pychpp.chpp.CHPP object at 0x7fefb03853a0>,
'_data': <Element 'HattrickData' at 0x7fefb078c4f0>,
'arena_ht_id': 9838,
'arena_name': 'Nyvångsskolans idrottsfält',
...
'name': 'Dalby Stenbrotters FC',
Which is not really expected and really strange. It prints out the data of the primary team both times.
Maybe I should get the teams in a different way? Regardless, I'm a beginner in Python, so that might be the problem as well.
Edited by Albert Rigo