Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support multiple games #6

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1fbff58
migrate models.py to models directory
ifalatik Sep 28, 2024
706aa5f
migrate Player class to CsPlayer and add abstract Player class
ifalatik Sep 29, 2024
9706932
Add note to PlayerRole class
ifalatik Sep 29, 2024
32a3edd
move comment to correct class
ifalatik Sep 29, 2024
885dcd6
rename Match -> CsMatch and Tournament -> CsTournament
ifalatik Sep 29, 2024
f94e7d0
Rename CSGOSiteSetting -> SiteSetting
ifalatik Sep 29, 2024
2babcec
finish migration Match -> CsMatch
ifalatik Sep 29, 2024
5d5cc77
cleanup urls.py
ifalatik Sep 29, 2024
d34c0a0
rename LineupPlayer -> CsLineupPlayer
ifalatik Sep 29, 2024
5a07a3f
add verbose_name and verbose_name_plural to all CS specific models
ifalatik Sep 29, 2024
d137d3e
migrate PlayerRole to Enum
ifalatik Sep 29, 2024
7e5a01b
fix relation between CsMatch and CsTournament in Match class
ifalatik Sep 29, 2024
d5969c8
improve str representation for LineupPlayer models
ifalatik Sep 29, 2024
876ae79
remove cs_name attribute from Map as it's game specific
ifalatik Sep 29, 2024
05e37aa
Rename MatchMap -> CsMatchMap
ifalatik Sep 29, 2024
6c5f796
add verbose names to CsMatchMap
ifalatik Sep 29, 2024
1b78279
reorganize Tournament - move Meta class up
ifalatik Sep 29, 2024
5dfd72e
add first_map_at to filter for similar_matches_in_same_tournament
ifalatik Sep 29, 2024
c2cc127
rename Map -> CsMap
ifalatik Sep 29, 2024
a8600e5
remove delay_minutes as it's used nowhere
ifalatik Sep 29, 2024
cdb1183
rename MatchMap.played_map -> map
ifalatik Sep 29, 2024
f084736
move parts of Match and MatchMap to respecive OneOnOne abtract model …
ifalatik Sep 29, 2024
5b61fd9
Rename Lineup -> CsLineup
ifalatik Sep 29, 2024
7e6189d
move all meta options to implementations instead of abstract models
ifalatik Sep 29, 2024
9f5ed23
properly inherit abstract Meta classes
ifalatik Sep 29, 2024
76762cb
Serializers and Views: Rename CSGO -> Cs
ifalatik Sep 29, 2024
cd2b68e
fix class name
ifalatik Dec 2, 2024
11c37fe
fix related_name property for lineup_set and matchmap_set in CS imple…
ifalatik Dec 2, 2024
823deb4
fix matchmap_set type annotation in Match model
ifalatik Dec 2, 2024
2a4eb1b
fix save method to use the correct model type for fetching previous i…
ifalatik Dec 2, 2024
4f1908e
migrate context_data scorelines to CS2 values
ifalatik Dec 2, 2024
1d81700
add new line
ifalatik Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve str representation for LineupPlayer models
  • Loading branch information
ifalatik committed Sep 29, 2024

Verified

This commit was signed with the committer’s verified signature.
jpenilla Jason Penilla
commit d5969c85d54fa02e2a228d5bebc7783d6ac37b0c
2 changes: 1 addition & 1 deletion csgomatches/models/cs_models.py
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ class Meta:

def __str__(self):
if self.role:
return f'{self.player.ingame_name} ({self.role})'
return f'{self.player.ingame_name} ({self.role}) @ {self.lineup.team.name}'
return f'{self.player.ingame_name} @ {self.lineup.team.name}'

def save(self, *args, **kwargs):
3 changes: 3 additions & 0 deletions csgomatches/models/global_models.py
Original file line number Diff line number Diff line change
@@ -134,6 +134,9 @@ class LineupPlayer(models.Model):
class Meta:
abstract = True

def __str__(self):
return f'{self.player.ingame_name} @ {self.lineup.team.name}'


class Tournament(models.Model):
name = models.CharField(max_length=255)