pychpp 0.4.6__tar.gz → 0.4.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pychpp-0.4.6 → pychpp-0.4.7}/PKG-INFO +7 -2
- {pychpp-0.4.6 → pychpp-0.4.7}/README.md +6 -1
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/chpp.py +59 -1
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/ht_field.py +1 -1
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/ht_model.py +3 -1
- pychpp-0.4.7/pychpp/models/xml/player_events.py +41 -0
- pychpp-0.4.7/pychpp/models/xml/search.py +49 -0
- pychpp-0.4.7/pychpp/models/xml/staff_avatars.py +61 -0
- pychpp-0.4.7/pychpp/models/xml/staff_list.py +58 -0
- pychpp-0.4.7/pychpp/models/xml/supporters.py +104 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pyproject.toml +1 -1
- {pychpp-0.4.6 → pychpp-0.4.7}/LICENSE +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/__init__.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/fixtures/__init__.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/fixtures/ht_datetime.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/fixtures/ht_error.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/__init__.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/__init__.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/__init__.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/ht_arena.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/ht_country.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/ht_league.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/ht_league_unit.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/ht_match.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/ht_player.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/ht_region.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/ht_team.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/base/ht_user.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_arena.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_challenge.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_league.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_league_unit.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_match.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_match_lineup.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_matches_archive.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_player.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_region.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_team.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_transfer_history.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_user.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_youth_player.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/custom/ht_youth_team.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/ht_init_var.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/ht_version.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/ht_xml.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/__init__.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/achievements.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/alliance_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/alliances.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/arena_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/avatars.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/bookmarks.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/challenges.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/club.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/cup_matches.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/current_bids.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/economy.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/fans.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/hof_players.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/ladder_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/ladder_list.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/league_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/league_fixtures.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/league_levels.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/live.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/manager_compendium.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/match_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/match_lineup.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/match_orders.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/matches.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/matches_archive.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/national_players.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/national_team_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/national_team_matches.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/national_teams.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/player_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/players.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/region_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/team_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/training.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/transfers_team.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/world_cup.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/world_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/youth_player_details.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/youth_player_list.py +0 -0
- {pychpp-0.4.6 → pychpp-0.4.7}/pychpp/models/xml/youth_team_details.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pychpp
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: framework created to use the API provided by the online game Hattrick
|
|
5
5
|
Home-page: https://framagit.org/Pierre86/pychpp
|
|
6
6
|
License: Apache-2.0
|
|
@@ -165,7 +165,7 @@ Then, to use this new class:
|
|
|
165
165
|
In this way, only the data you're really interested in is parsed, which can in some cases be interesting from a performance point of view.
|
|
166
166
|
|
|
167
167
|
## List of supported CHPP XML files
|
|
168
|
-

|
|
169
169
|
|
|
170
170
|
The following table shows the CHPP XML files that are currently supported:
|
|
171
171
|
|
|
@@ -201,8 +201,13 @@ The following table shows the CHPP XML files that are currently supported:
|
|
|
201
201
|
| NationalTeams | `nationalteams.xml` |
|
|
202
202
|
| NationalPlayers | `nationalplayers.xml` |
|
|
203
203
|
| PlayerDetails | `playerdetails.xml` |
|
|
204
|
+
| PlayerEvents | `playerevents.xml` |
|
|
204
205
|
| Players | `players.xml` |
|
|
205
206
|
| RegionDetails | `regiondetails.xml` |
|
|
207
|
+
| Search | `search.xml` |
|
|
208
|
+
| StaffAvatars | `staffavatars.xml` |
|
|
209
|
+
| StaffList | `stafflist.xml` |
|
|
210
|
+
| Supporters | `supporters.xml` |
|
|
206
211
|
| TeamDetails | `teamdetails.xml` |
|
|
207
212
|
| Training | `training.xml` |
|
|
208
213
|
| TransfersTeam | `transfersteam.xml` |
|
|
@@ -143,7 +143,7 @@ Then, to use this new class:
|
|
|
143
143
|
In this way, only the data you're really interested in is parsed, which can in some cases be interesting from a performance point of view.
|
|
144
144
|
|
|
145
145
|
## List of supported CHPP XML files
|
|
146
|
-

|
|
147
147
|
|
|
148
148
|
The following table shows the CHPP XML files that are currently supported:
|
|
149
149
|
|
|
@@ -179,8 +179,13 @@ The following table shows the CHPP XML files that are currently supported:
|
|
|
179
179
|
| NationalTeams | `nationalteams.xml` |
|
|
180
180
|
| NationalPlayers | `nationalplayers.xml` |
|
|
181
181
|
| PlayerDetails | `playerdetails.xml` |
|
|
182
|
+
| PlayerEvents | `playerevents.xml` |
|
|
182
183
|
| Players | `players.xml` |
|
|
183
184
|
| RegionDetails | `regiondetails.xml` |
|
|
185
|
+
| Search | `search.xml` |
|
|
186
|
+
| StaffAvatars | `staffavatars.xml` |
|
|
187
|
+
| StaffList | `stafflist.xml` |
|
|
188
|
+
| Supporters | `supporters.xml` |
|
|
184
189
|
| TeamDetails | `teamdetails.xml` |
|
|
185
190
|
| Training | `training.xml` |
|
|
186
191
|
| TransfersTeam | `transfersteam.xml` |
|
|
@@ -14,7 +14,8 @@ from pychpp.models.xml import (manager_compendium, team_details, achievements, a
|
|
|
14
14
|
matches_archive, match_details, cup_matches, alliances,
|
|
15
15
|
alliance_details, avatars, bookmarks, club, current_bids, economy,
|
|
16
16
|
fans, hof_players, ladder_details, ladder_list, league_levels, live,
|
|
17
|
-
matches, match_orders, national_team_matches, national_players
|
|
17
|
+
matches, match_orders, national_team_matches, national_players,
|
|
18
|
+
player_events, search, staff_avatars, staff_list, supporters)
|
|
18
19
|
from pychpp.models.custom import (ht_team, ht_arena, ht_user, ht_region, ht_youth_team, ht_player,
|
|
19
20
|
ht_league_unit, ht_youth_player, ht_league, ht_matches_archive,
|
|
20
21
|
ht_match, ht_challenge, ht_match_lineup, ht_transfer_history)
|
|
@@ -789,6 +790,14 @@ class CHPPXml(CHPPBase):
|
|
|
789
790
|
raise ValueError("if set, 'action_type' must be equal to"
|
|
790
791
|
"'view', 'setmatchorder' or 'SupporterStats'")
|
|
791
792
|
|
|
793
|
+
def xml_player_events(
|
|
794
|
+
self, player_id: int = None, **kwargs,
|
|
795
|
+
) -> player_events.PlayerEvents:
|
|
796
|
+
|
|
797
|
+
return player_events.PlayerEvents(
|
|
798
|
+
chpp=self, player_id=player_id, **kwargs,
|
|
799
|
+
)
|
|
800
|
+
|
|
792
801
|
def xml_players(self, action_type: str = 'view', order_by: str = None,
|
|
793
802
|
team_id: int = None, include_match_info: bool = None, **kwargs,
|
|
794
803
|
) -> Union[players.PlayersView,
|
|
@@ -836,6 +845,55 @@ class CHPPXml(CHPPBase):
|
|
|
836
845
|
chpp=self, region_id=region_id, **kwargs,
|
|
837
846
|
)
|
|
838
847
|
|
|
848
|
+
def xml_search(
|
|
849
|
+
self, search_type: int = None, search_string: str = None,
|
|
850
|
+
search_string_2: str = None, search_id: int = None, search_league_id: int = None,
|
|
851
|
+
page_index: int = None, **kwargs,
|
|
852
|
+
) -> search.Search:
|
|
853
|
+
|
|
854
|
+
return search.Search(
|
|
855
|
+
chpp=self, search_type=search_type, search_string=search_string,
|
|
856
|
+
search_string_2=search_string_2, search_id=search_id,
|
|
857
|
+
search_league_id=search_league_id, page_index=page_index, **kwargs,
|
|
858
|
+
)
|
|
859
|
+
|
|
860
|
+
def xml_staff_avatars(
|
|
861
|
+
self, team_id: int = None, **kwargs,
|
|
862
|
+
) -> staff_avatars.StaffAvatars:
|
|
863
|
+
|
|
864
|
+
return staff_avatars.StaffAvatars(
|
|
865
|
+
chpp=self, team_id=team_id, **kwargs,
|
|
866
|
+
)
|
|
867
|
+
|
|
868
|
+
def xml_staff_list(
|
|
869
|
+
self, team_id: int = None, **kwargs,
|
|
870
|
+
) -> staff_list.StaffList:
|
|
871
|
+
|
|
872
|
+
return staff_list.StaffList(
|
|
873
|
+
chpp=self, team_id=team_id, **kwargs,
|
|
874
|
+
)
|
|
875
|
+
|
|
876
|
+
def xml_supporters(
|
|
877
|
+
self, action_type: str = 'supportedteams',
|
|
878
|
+
user_id: int = None, team_id: int = None, **kwargs,
|
|
879
|
+
) -> Union[supporters.SupportersSupportedTeams,
|
|
880
|
+
supporters.SupportersMySupporters,
|
|
881
|
+
]:
|
|
882
|
+
|
|
883
|
+
if action_type == 'supportedteams':
|
|
884
|
+
return supporters.SupportersSupportedTeams(
|
|
885
|
+
chpp=self, action_type=action_type, user_id=user_id, **kwargs,
|
|
886
|
+
)
|
|
887
|
+
|
|
888
|
+
elif action_type == 'mysupporters':
|
|
889
|
+
return supporters.SupportersMySupporters(
|
|
890
|
+
chpp=self, action_type=action_type, team_id=team_id, **kwargs,
|
|
891
|
+
)
|
|
892
|
+
|
|
893
|
+
else:
|
|
894
|
+
raise ValueError("if set, 'action_type' must be equal to"
|
|
895
|
+
"'view', 'supportedteams' or 'mysupporters'")
|
|
896
|
+
|
|
839
897
|
def xml_team_details(
|
|
840
898
|
self, team_id: int = None, user_id: int = None,
|
|
841
899
|
include_domestics_flags: bool = None, include_flags: bool = None,
|
|
@@ -211,7 +211,9 @@ class HTModel(metaclass=MetaHTModel):
|
|
|
211
211
|
if proxy_path and proxy_path[-1] != '/':
|
|
212
212
|
proxy_path += '/'
|
|
213
213
|
proxy_path += previous_xml_prefix + target_field.path
|
|
214
|
-
previous_xml_prefix = target_field.xml_prefix
|
|
214
|
+
previous_xml_prefix = (target_field.xml_prefix
|
|
215
|
+
if target_field.xml_prefix is not None
|
|
216
|
+
else '')
|
|
215
217
|
|
|
216
218
|
if issubclass(type_, HTModel):
|
|
217
219
|
target_cls = type_
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from pychpp.models.ht_field import HTField
|
|
5
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
6
|
+
from pychpp.models.ht_model import HTModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RequestPlayerEvents(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Player Events - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'playerevents'
|
|
14
|
+
LAST_VERSION = '1.3'
|
|
15
|
+
|
|
16
|
+
_r_player_id: int = HTInitVar('playerID', init_arg='player_id')
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class PlayerEvents(RequestPlayerEvents):
|
|
20
|
+
"""
|
|
21
|
+
Player Events
|
|
22
|
+
"""
|
|
23
|
+
user_supporter_tier: str = HTField('UserSupporterTier')
|
|
24
|
+
player: 'Player' = HTField('Player')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Player(HTModel):
|
|
28
|
+
"""
|
|
29
|
+
Player Events -> Player
|
|
30
|
+
"""
|
|
31
|
+
id: int = HTField('PlayerID')
|
|
32
|
+
events: List['EventItem'] = HTField('PlayerEvents', items='PlayerEvent')
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class EventItem(HTModel):
|
|
36
|
+
"""
|
|
37
|
+
Player Events -> Player -> Events -> Event item
|
|
38
|
+
"""
|
|
39
|
+
date: datetime = HTField('EventDate')
|
|
40
|
+
type_id: int = HTField('PlayerEventTypeID')
|
|
41
|
+
text: str = HTField('EventText')
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from typing import Optional, List
|
|
2
|
+
|
|
3
|
+
from pychpp.models.ht_field import HTField
|
|
4
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
5
|
+
from pychpp.models.ht_model import HTModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RequestSearch(HTModel):
|
|
9
|
+
"""
|
|
10
|
+
Search - Request arguments
|
|
11
|
+
"""
|
|
12
|
+
SOURCE_FILE = 'search'
|
|
13
|
+
LAST_VERSION = '1.2'
|
|
14
|
+
|
|
15
|
+
_r_search_type: Optional[int] = HTInitVar('searchType', init_arg='search_type')
|
|
16
|
+
_r_search_string: Optional[str] = HTInitVar('searchString', init_arg='search_string')
|
|
17
|
+
_r_search_string_2: Optional[int] = HTInitVar('searchString2', init_arg='search_string_2')
|
|
18
|
+
_r_search_id: Optional[int] = HTInitVar('searchID', init_arg='search_id')
|
|
19
|
+
_r_search_league_id: Optional[int] = HTInitVar('searchLeagueID', init_arg='search_league_id')
|
|
20
|
+
_r_page_index: Optional[int] = HTInitVar('pageIndex', init_arg='page_index')
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Search(RequestSearch):
|
|
24
|
+
"""
|
|
25
|
+
Search
|
|
26
|
+
"""
|
|
27
|
+
search_params: 'SearchParams' = HTField('SearchParams')
|
|
28
|
+
page_index: int = HTField('PageIndex')
|
|
29
|
+
pages: int = HTField('Pages')
|
|
30
|
+
search_results: List['ResultItem'] = HTField('SearchResults', items='Result')
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class SearchParams(HTModel):
|
|
34
|
+
"""
|
|
35
|
+
Search -> Search params
|
|
36
|
+
"""
|
|
37
|
+
type: int = HTField('SearchType')
|
|
38
|
+
string: str = HTField('SearchString')
|
|
39
|
+
string_2: str = HTField('SearchString2')
|
|
40
|
+
id: int = HTField('SearchID')
|
|
41
|
+
league_id: int = HTField('SearchLeagueID')
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class ResultItem(HTModel):
|
|
45
|
+
"""
|
|
46
|
+
Search -> Search results -> Result item
|
|
47
|
+
"""
|
|
48
|
+
id: int = HTField('ResultID')
|
|
49
|
+
name: str = HTField('ResultName')
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from pychpp.models.ht_field import HTField
|
|
4
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
5
|
+
from pychpp.models.ht_model import HTModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RequestStaffAvatars(HTModel):
|
|
9
|
+
"""
|
|
10
|
+
Staff Avatars - Request arguments
|
|
11
|
+
"""
|
|
12
|
+
SOURCE_FILE = 'staffavatars'
|
|
13
|
+
LAST_VERSION = '1.1'
|
|
14
|
+
|
|
15
|
+
_r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class StaffAvatars(RequestStaffAvatars):
|
|
19
|
+
"""
|
|
20
|
+
Staff Avatars
|
|
21
|
+
"""
|
|
22
|
+
trainer: 'Trainer' = HTField('Trainer')
|
|
23
|
+
staff_members: List['StaffMemberItem'] = HTField('StaffMembers', items='Staff')
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class CommonTrainerStaffMemberItem(HTModel):
|
|
27
|
+
"""
|
|
28
|
+
Staff Avatars -> Trainer / Staff member item
|
|
29
|
+
"""
|
|
30
|
+
avatar: 'Avatar' = HTField('Avatar')
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Avatar(HTModel):
|
|
34
|
+
"""
|
|
35
|
+
Staff Avatars -> Trainer / Staff member item -> Avatar
|
|
36
|
+
"""
|
|
37
|
+
background_image: str = HTField('BackgroundImage')
|
|
38
|
+
layers: List['LayerItem'] = HTField('.', items='Layer')
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class LayerItem(HTModel):
|
|
42
|
+
"""
|
|
43
|
+
Staff Avatars -> Trainer / Staff member item -> Avatar -> Layer
|
|
44
|
+
"""
|
|
45
|
+
x: int = HTField('.', attrib='x')
|
|
46
|
+
y: int = HTField('.', attrib='y')
|
|
47
|
+
image: str = HTField('Image')
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class Trainer(CommonTrainerStaffMemberItem):
|
|
51
|
+
"""
|
|
52
|
+
Staff Avatars -> Trainer
|
|
53
|
+
"""
|
|
54
|
+
id: int = HTField('TrainerId')
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class StaffMemberItem(CommonTrainerStaffMemberItem):
|
|
58
|
+
"""
|
|
59
|
+
Staff Avatars -> Staff members -> Staff member item
|
|
60
|
+
"""
|
|
61
|
+
id: int = HTField('StaffId')
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
|
|
4
|
+
from pychpp.models.ht_field import HTField
|
|
5
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
6
|
+
from pychpp.models.ht_model import HTModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RequestStaffList(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Staff List - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'stafflist'
|
|
14
|
+
LAST_VERSION = '1.2'
|
|
15
|
+
|
|
16
|
+
_r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class StaffList(RequestStaffList):
|
|
20
|
+
"""
|
|
21
|
+
Staff List
|
|
22
|
+
"""
|
|
23
|
+
XML_PREFIX = 'StaffList/'
|
|
24
|
+
|
|
25
|
+
trainer: 'Trainer' = HTField('Trainer')
|
|
26
|
+
staff_members: List['StaffMemberItem'] = HTField('StaffMembers', items='Staff')
|
|
27
|
+
total_staff_members: int = HTField('TotalStaffMembers')
|
|
28
|
+
total_cost: int = HTField('TotalCost')
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class Trainer(HTModel):
|
|
32
|
+
"""
|
|
33
|
+
Staff List -> Trainer
|
|
34
|
+
"""
|
|
35
|
+
id: int = HTField('TrainerId')
|
|
36
|
+
name: str = HTField('Name')
|
|
37
|
+
age: int = HTField('Age')
|
|
38
|
+
age_days: int = HTField('AgeDays')
|
|
39
|
+
contract_date: datetime = HTField('ContractDate')
|
|
40
|
+
cost: int = HTField('Cost')
|
|
41
|
+
country_id: int = HTField('CountryID')
|
|
42
|
+
type: int = HTField('TrainerType')
|
|
43
|
+
leadership: int = HTField('Leadership')
|
|
44
|
+
skill_level: int = HTField('TrainerSkillLevel')
|
|
45
|
+
status: int = HTField('TrainerStatus')
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class StaffMemberItem(HTModel):
|
|
49
|
+
"""
|
|
50
|
+
Staff List -> Staff members -> Staff member item
|
|
51
|
+
"""
|
|
52
|
+
id: int = HTField('StaffId')
|
|
53
|
+
name: str = HTField('Name')
|
|
54
|
+
type: int = HTField('StaffType')
|
|
55
|
+
level: int = HTField('StaffLevel')
|
|
56
|
+
hired_date: datetime = HTField('HiredDate')
|
|
57
|
+
cost: int = HTField('Cost')
|
|
58
|
+
hof_player_id: int = HTField('HofPlayerId')
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
|
|
4
|
+
from pychpp.models.ht_field import HTField
|
|
5
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
6
|
+
from pychpp.models.ht_model import HTModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RequestSupporters(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Supporters - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'supporters'
|
|
14
|
+
LAST_VERSION = '1.0'
|
|
15
|
+
|
|
16
|
+
_r_action_type: Optional[str] = HTInitVar('actionType', init_arg='action_type')
|
|
17
|
+
_r_user_id: Optional[int] = HTInitVar('userId', init_arg='user_id')
|
|
18
|
+
_r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
|
|
19
|
+
_r_page_index: Optional[int] = HTInitVar('pageIndex', init_arg='page_index')
|
|
20
|
+
_r_page_size: Optional[int] = HTInitVar('pageSize', init_arg='page_size')
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class SupportersSupportedTeams(RequestSupporters):
|
|
24
|
+
"""
|
|
25
|
+
Supporters - Supported teams
|
|
26
|
+
"""
|
|
27
|
+
total_supported_teams: int = HTField('SupportedTeams', attrib='TotalItems')
|
|
28
|
+
supported_teams: List['SupportedTeamItem'] = HTField('SupportedTeams', items='SupportedTeam')
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class SupportersMySupporters(RequestSupporters):
|
|
32
|
+
"""
|
|
33
|
+
Supporters - My supporters
|
|
34
|
+
"""
|
|
35
|
+
total_supporters: int = HTField('MySupporters', attrib='TotalItems')
|
|
36
|
+
my_supporters: List['MySupportersTeamItem'] = HTField('MySupporters', items='SupporterTeam')
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class CommonTeamItem(HTModel):
|
|
40
|
+
"""
|
|
41
|
+
Supporters - Supported teams/My Supporters -> Supported teams/My Supporters -> Team item
|
|
42
|
+
"""
|
|
43
|
+
user_id: int = HTField('UserId')
|
|
44
|
+
login_name: str = HTField('LoginName')
|
|
45
|
+
team_id: int = HTField('TeamId')
|
|
46
|
+
team_name: str = HTField('TeamName')
|
|
47
|
+
league_id: int = HTField('LeagueID')
|
|
48
|
+
league_name: str = HTField('LeagueName')
|
|
49
|
+
league_level_unit_id: int = HTField('LeagueLevelUnitID')
|
|
50
|
+
league_level_unit_name: str = HTField('LeagueLevelUnitName')
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class SupportedTeamItem(CommonTeamItem):
|
|
54
|
+
"""
|
|
55
|
+
Supporters - Supported teams -> Supported teams -> Team item
|
|
56
|
+
"""
|
|
57
|
+
last_match: 'LastMatch' = HTField('LastMatch')
|
|
58
|
+
next_match: 'NextMatch' = HTField('NextMatch')
|
|
59
|
+
press_announcement: Optional['PressAnnouncement'] = HTField('PressAnnouncement')
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class MySupportersTeamItem(CommonTeamItem):
|
|
63
|
+
"""
|
|
64
|
+
Supporters - Supported teams -> My Supporters -> Team item
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class CommonLastNextMatch(HTModel):
|
|
69
|
+
"""
|
|
70
|
+
Supporters - Supported teams -> Supported teams -> Team item -> Last/Next match
|
|
71
|
+
"""
|
|
72
|
+
id: int = HTField('Id')
|
|
73
|
+
date: datetime = HTField('Date')
|
|
74
|
+
home_team_id: int = HTField('HomeTeamId')
|
|
75
|
+
home_team_name: str = HTField('HomeTeamName')
|
|
76
|
+
away_team_id: int = HTField('AwayTeamId')
|
|
77
|
+
away_team_name: str = HTField('AwayTeamName')
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class LastMatch(CommonLastNextMatch):
|
|
81
|
+
"""
|
|
82
|
+
Supporters - Supported teams -> Supported teams -> Team item -> Last match
|
|
83
|
+
"""
|
|
84
|
+
XML_PREFIX = 'LastMatch'
|
|
85
|
+
home_goals: int = HTField('HomeGoals')
|
|
86
|
+
away_goals: int = HTField('AwayGoals')
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class NextMatch(CommonLastNextMatch):
|
|
90
|
+
"""
|
|
91
|
+
Supporters - Supported teams -> Supported teams -> Team item -> Next match
|
|
92
|
+
"""
|
|
93
|
+
XML_PREFIX = 'NextMatch'
|
|
94
|
+
date: datetime = HTField('MatchDate')
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class PressAnnouncement(HTModel):
|
|
98
|
+
"""
|
|
99
|
+
Supporters - Supported teams -> Supported teams -> Team item -> Press Announcement
|
|
100
|
+
"""
|
|
101
|
+
XML_PREFIX = 'PressAnnouncement'
|
|
102
|
+
send_date: datetime = HTField('SendDate')
|
|
103
|
+
subject: str = HTField('Subject')
|
|
104
|
+
body: str = HTField('Body')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|