update server

clubs
Razmig Sarkissian 2 years ago
parent 6ca0fcbbed
commit a8d3226bc8
  1. 10
      tournaments/admin.py
  2. 86
      tournaments/migrations/0032_remove_playerregistration_has_paid_and_more.py
  3. 166
      tournaments/migrations/0033_rename_bracket_sort_mode_tournament_group_stage_sort_mode_and_more.py
  4. 18
      tournaments/migrations/0034_alter_teamscore_lucky_loser.py
  5. 18
      tournaments/migrations/0035_customuser_match_formats_default_duration.py
  6. 18
      tournaments/migrations/0036_alter_playerregistration_source.py
  7. 28
      tournaments/migrations/0037_rename_weight_playerregistration_computed_rank_and_more.py
  8. 3
      tournaments/models/__init__.py
  9. 11
      tournaments/models/court.py
  10. 16
      tournaments/models/custom_user.py
  11. 9
      tournaments/models/date_interval.py
  12. 10
      tournaments/models/event.py
  13. 2
      tournaments/models/group_stage.py
  14. 8
      tournaments/models/match.py
  15. 21
      tournaments/models/player_enums.py
  16. 29
      tournaments/models/player_registration.py
  17. 9
      tournaments/models/team_registration.py
  18. 2
      tournaments/models/team_score.py
  19. 9
      tournaments/models/tournament.py
  20. 14
      tournaments/serializers.py
  21. 12
      tournaments/views.py

@ -1,5 +1,5 @@
from django.contrib import admin
from .models import Club, TeamScore, Tournament, CustomUser, Event, Round, GroupStage, Match, TeamRegistration, PlayerRegistration, Purchase
from .models import Club, TeamScore, Tournament, CustomUser, Event, Round, GroupStage, Match, TeamRegistration, PlayerRegistration, Purchase, Court, DateInterval
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
@ -53,6 +53,12 @@ class ClubAdmin(admin.ModelAdmin):
class PurchaseAdmin(admin.ModelAdmin):
list_display = ['user', 'identifier', 'purchase_date', 'product_id', 'quantity']
class CourtAdmin(admin.ModelAdmin):
list_display = ['index', 'name', 'club']
class DateIntervalAdmin(admin.ModelAdmin):
list_display = ['court_index', 'event']
admin.site.register(CustomUser, CustomUserAdmin)
admin.site.register(Club, ClubAdmin)
admin.site.register(Event, EventAdmin)
@ -64,3 +70,5 @@ admin.site.register(TeamRegistration, TeamRegistrationAdmin)
admin.site.register(Tournament, TournamentAdmin)
admin.site.register(PlayerRegistration, PlayerRegistrationAdmin)
admin.site.register(Purchase, PurchaseAdmin)
admin.site.register(Court, CourtAdmin)
admin.site.register(DateInterval, DateIntervalAdmin)

@ -0,0 +1,86 @@
# Generated by Django 4.2.11 on 2024-05-02 15:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0031_tournament_is_canceled_tournament_is_deleted'),
]
operations = [
migrations.RemoveField(
model_name='playerregistration',
name='has_paid',
),
migrations.RemoveField(
model_name='playerregistration',
name='unranked',
),
migrations.AddField(
model_name='playerregistration',
name='assimilation',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AddField(
model_name='playerregistration',
name='birthdate',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
model_name='playerregistration',
name='club_name',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AddField(
model_name='playerregistration',
name='email',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AddField(
model_name='playerregistration',
name='has_arrived',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='playerregistration',
name='ligue_name',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AddField(
model_name='playerregistration',
name='payment_type',
field=models.IntegerField(blank=True, choices=[(0, 'Cash'), (1, 'Lydia'), (2, 'Gift'), (3, 'Check'), (4, 'Paylib'), (5, 'Bank Wire'), (6, 'Club House'), (7, 'Credit Card'), (8, 'Forfeit')], null=True),
),
migrations.AddField(
model_name='playerregistration',
name='phone_number',
field=models.CharField(blank=True, max_length=15, null=True),
),
migrations.AddField(
model_name='playerregistration',
name='points',
field=models.FloatField(blank=True, null=True),
),
migrations.AddField(
model_name='playerregistration',
name='sex',
field=models.IntegerField(blank=True, choices=[(0, 'Female'), (1, 'Male')], null=True),
),
migrations.AddField(
model_name='playerregistration',
name='source',
field=models.IntegerField(blank=True, null=True, verbose_name=[(0, 'French Federation'), (1, 'Beach Padel')]),
),
migrations.AddField(
model_name='playerregistration',
name='tournament_played',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='playerregistration',
name='weight',
field=models.IntegerField(default=0),
),
]

@ -0,0 +1,166 @@
# Generated by Django 4.2.11 on 2024-05-02 15:55
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0032_remove_playerregistration_has_paid_and_more'),
]
operations = [
migrations.RenameField(
model_name='tournament',
old_name='bracket_sort_mode',
new_name='group_stage_sort_mode',
),
migrations.RemoveField(
model_name='event',
name='court_count',
),
migrations.RemoveField(
model_name='event',
name='group_stage_format',
),
migrations.RemoveField(
model_name='event',
name='loser_round_format',
),
migrations.RemoveField(
model_name='event',
name='round_format',
),
migrations.RemoveField(
model_name='match',
name='broadcasted',
),
migrations.RemoveField(
model_name='match',
name='court',
),
migrations.RemoveField(
model_name='match',
name='order',
),
migrations.RemoveField(
model_name='tournament',
name='seed_count',
),
migrations.AddField(
model_name='customuser',
name='bracket_match_format_preference',
field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point')], default=3, null=True),
),
migrations.AddField(
model_name='customuser',
name='call_display_entry_fee',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='customuser',
name='call_display_format',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='customuser',
name='call_message_body',
field=models.CharField(blank=True, max_length=400, null=True),
),
migrations.AddField(
model_name='customuser',
name='call_message_signature',
field=models.CharField(blank=True, max_length=200, null=True),
),
migrations.AddField(
model_name='customuser',
name='call_use_full_custom_message',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='customuser',
name='group_stage_match_format_preference',
field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point')], default=3, null=True),
),
migrations.AddField(
model_name='customuser',
name='loser_bracket_match_format_preference',
field=models.IntegerField(blank=True, choices=[(0, 'Two sets'), (1, 'Two sets super tie'), (2, 'Two sets of four games'), (3, 'Nine games'), (4, 'Super Tie-Break'), (5, 'Mega Tie-Break'), (6, 'Two Sets with decisive point'), (7, 'Two Sets with decisive point and super tie-break'), (8, 'Two sets of four games with decisive point'), (9, 'Nine games with decisive point')], default=3, null=True),
),
migrations.AddField(
model_name='groupstage',
name='size',
field=models.IntegerField(default=4),
),
migrations.AddField(
model_name='match',
name='court_index',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='match',
name='disabled',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='teamregistration',
name='lock_weight',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='teamregistration',
name='qualified',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='teamregistration',
name='walk_out',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='teamregistration',
name='wild_card_bracket',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='teamregistration',
name='wild_card_group_stage',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='tournament',
name='additional_estimation_duration',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='tournament',
name='entry_fee',
field=models.FloatField(blank=True, default=20.0, null=True),
),
migrations.AlterField(
model_name='tournament',
name='court_count',
field=models.IntegerField(default=1),
),
migrations.CreateModel(
name='DateInterval',
fields=[
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
('court_index', models.IntegerField()),
('start_date', models.DateTimeField()),
('end_date', models.DateTimeField()),
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tournaments.event')),
],
),
migrations.CreateModel(
name='Court',
fields=[
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
('index', models.IntegerField(default=0)),
('name', models.CharField(blank=True, max_length=50, null=True)),
('club', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tournaments.club')),
],
),
]

@ -0,0 +1,18 @@
# Generated by Django 4.2.11 on 2024-05-02 16:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0033_rename_bracket_sort_mode_tournament_group_stage_sort_mode_and_more'),
]
operations = [
migrations.AlterField(
model_name='teamscore',
name='lucky_loser',
field=models.IntegerField(blank=True, null=True),
),
]

@ -0,0 +1,18 @@
# Generated by Django 4.2.11 on 2024-05-02 16:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0034_alter_teamscore_lucky_loser'),
]
operations = [
migrations.AddField(
model_name='customuser',
name='match_formats_default_duration',
field=models.JSONField(blank=True, null=True),
),
]

@ -0,0 +1,18 @@
# Generated by Django 4.2.11 on 2024-05-02 17:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0035_customuser_match_formats_default_duration'),
]
operations = [
migrations.AlterField(
model_name='playerregistration',
name='source',
field=models.IntegerField(blank=True, choices=[(0, 'French Federation'), (1, 'Beach Padel')], null=True),
),
]

@ -0,0 +1,28 @@
# Generated by Django 4.2.11 on 2024-05-04 09:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0036_alter_playerregistration_source'),
]
operations = [
migrations.RenameField(
model_name='playerregistration',
old_name='weight',
new_name='computed_rank',
),
migrations.AlterField(
model_name='customuser',
name='call_message_body',
field=models.TextField(blank=True, null=True),
),
migrations.AlterField(
model_name='customuser',
name='call_message_signature',
field=models.TextField(blank=True, null=True),
),
]

@ -1,6 +1,9 @@
from .custom_user import CustomUser
from .club import Club
from .court import Court
from .date_interval import DateInterval
from .enums import TournamentPayment, FederalCategory, FederalLevelCategory, FederalAgeCategory, FederalMatchCategory
from .player_enums import PlayerSexType, PlayerDataSource, PlayerPaymentType
from .event import Event
from .tournament import Tournament, TeamSummon
from .group_stage import GroupStage

@ -0,0 +1,11 @@
from django.db import models
import uuid
from . import Club
class Court(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=True)
index = models.IntegerField(default=0)
club = models.ForeignKey(Club, on_delete=models.CASCADE)
name = models.CharField(max_length=50, null=True, blank=True)
#exit_allowed = models.BooleanField(default=False)
#indoor = models.BooleanField(default=False)

@ -1,6 +1,6 @@
from django.db import models
from django.contrib.auth.models import AbstractUser
from . import club
from . import club, enums
import uuid
class CustomUser(AbstractUser):
@ -14,5 +14,19 @@ class CustomUser(AbstractUser):
licence_id = models.CharField(max_length=10, null=True, blank=True)
country = models.CharField(max_length=40, null=True, blank=True)
#taille infini?
call_message_body = models.TextField(blank=True, null=True)
call_message_signature = models.TextField(blank=True, null=True)
call_display_format = models.BooleanField(default=False)
call_display_entry_fee = models.BooleanField(default=False)
call_use_full_custom_message = models.BooleanField(default=False)
match_formats_default_duration = models.JSONField(blank=True, null=True)
bracket_match_format_preference = models.IntegerField(default=enums.FederalMatchCategory.NINE_GAMES, choices=enums.FederalMatchCategory.choices, null=True, blank=True)
group_stage_match_format_preference = models.IntegerField(default=enums.FederalMatchCategory.NINE_GAMES, choices=enums.FederalMatchCategory.choices, null=True, blank=True)
loser_bracket_match_format_preference = models.IntegerField(default=enums.FederalMatchCategory.NINE_GAMES, choices=enums.FederalMatchCategory.choices, null=True, blank=True)
def __str__(self):
return self.username

@ -0,0 +1,9 @@
from django.db import models
import uuid
class DateInterval(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=True)
event = models.ForeignKey('Event', on_delete=models.CASCADE)
court_index = models.IntegerField()
start_date = models.DateTimeField()
end_date = models.DateTimeField()

@ -1,5 +1,5 @@
from django.db import models
from . import Club, CustomUser, FederalMatchCategory
from . import Club, CustomUser
import uuid
class Event(models.Model):
@ -9,11 +9,11 @@ class Event(models.Model):
creator = models.ForeignKey(CustomUser, blank=True, null=True, on_delete=models.CASCADE)
name = models.CharField(max_length=200, null=True, blank=True)
federal_tournament_data = models.JSONField(null=True, blank=True)
court_count = models.IntegerField(null=True, blank=True)
#court_count = models.IntegerField(null=True, blank=True)
tenup_id = models.CharField(max_length=20, null=True, blank=True)
group_stage_format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
round_format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
loser_round_format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
#group_stage_format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
#round_format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
#loser_round_format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
def __str__(self):
return self.display_name()

@ -9,8 +9,10 @@ class GroupStage(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=True)
tournament = models.ForeignKey(Tournament, on_delete=models.CASCADE)
index = models.IntegerField(default=0)
size = models.IntegerField(default=4)
format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
start_date = models.DateTimeField(null=True, blank=True)
name = models.CharField(max_length=200, null=True, blank=True)
def __str__(self):
return f"{self.tournament.display_name()} - {self.name()}"

@ -11,13 +11,15 @@ class Match(models.Model):
start_date = models.DateTimeField(null=True, blank=True)
end_date = models.DateTimeField(null=True, blank=True)
index = models.IntegerField(default=0)
order = models.IntegerField(default=0)
#order = models.IntegerField(default=0)
format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
court = models.CharField(max_length=50, null=True, blank=True)
#court = models.CharField(max_length=50, null=True, blank=True)
serving_team_id = models.UUIDField(null=True, blank=True)
winning_team_id = models.UUIDField(null=True, blank=True)
losing_team_id = models.UUIDField(null=True, blank=True)
broadcasted = models.BooleanField(default=False)
#broadcasted = models.BooleanField(default=False)
disabled = models.BooleanField(default=False)
court_index = models.IntegerField(null=True, blank=True)
def __str__(self):
names = " / ".join(self.player_names())

@ -0,0 +1,21 @@
from django.db import models
import uuid
class PlayerPaymentType(models.IntegerChoices):
CASH = 0, 'Cash'
LYDIA = 1, 'Lydia'
GIFT = 2, 'Gift'
CHECK = 3, 'Check'
PAYLIB = 4, 'Paylib'
BANK_WIRE = 5, 'Bank Wire'
CLUB_HOUSE = 6, 'Club House'
CREDIT_CARD = 7, 'Credit Card'
FORFEIT = 8, 'Forfeit'
class PlayerDataSource(models.IntegerChoices):
FRENCH_FEDERATION = 0, 'French Federation'
BEACH_PADEL = 1, 'Beach Padel'
class PlayerSexType(models.IntegerChoices):
FEMALE = 0, 'Female'
MALE = 1, 'Male'

@ -1,5 +1,5 @@
from django.db import models
from . import TeamRegistration
from . import TeamRegistration, PlayerSexType, PlayerDataSource, PlayerPaymentType
import uuid
class PlayerRegistration(models.Model):
@ -9,8 +9,31 @@ class PlayerRegistration(models.Model):
last_name = models.CharField(max_length=50)
licence_id = models.CharField(max_length=20, null=True, blank=True)
rank = models.IntegerField(null=True, blank=True)
has_paid = models.BooleanField(default=False)
unranked = models.BooleanField(default=False)
#has_paid = models.BooleanField(default=False)
#unranked = models.BooleanField(default=False)
payment_type = models.IntegerField(choices=PlayerPaymentType.choices, null=True, blank=True)
#registration_date = models.DateTimeField(null=True, blank=True)
sex = models.IntegerField(choices=PlayerSexType.choices, null=True, blank=True)
#donnee publique
tournament_played = models.IntegerField(null=True, blank=True)
points = models.FloatField(null=True, blank=True)
club_name = models.CharField(max_length=50, null=True, blank=True)
ligue_name = models.CharField(max_length=50, null=True, blank=True)
assimilation = models.CharField(max_length=50, null=True, blank=True)
#beachpadel
phone_number = models.CharField(max_length=15, null=True, blank=True)
email = models.CharField(max_length=50, null=True, blank=True)
birthdate = models.DateTimeField(null=True, blank=True)
computed_rank = models.IntegerField(default=0)
source = models.IntegerField(choices=PlayerDataSource.choices, null=True, blank=True)
has_arrived = models.BooleanField(default=False)
def __str__(self):
return self.name()

@ -18,6 +18,15 @@ class TeamRegistration(models.Model):
logo = models.CharField(max_length=200, null=True, blank=True) #models.FilePathField(path=os.path.join(settings.STATIC_ROOT, "images"), null=True, blank=True)
name = models.CharField(max_length=200, null=True, blank=True)
walk_out = models.BooleanField(default=False)
wild_card_bracket = models.BooleanField(default=False)
wild_card_group_stage = models.BooleanField(default=False)
weight = models.IntegerField(default=0)
lock_weight = models.IntegerField(null=True, blank=True)
#confirmation_date = models.DateTimeField(null=True, blank=True)
qualified = models.BooleanField(default=False)
def __str__(self):
if self.name:
return f"{self.name}: {self.player_names()}"

@ -9,7 +9,7 @@ class TeamScore(models.Model):
player_registrations = models.ManyToManyField(PlayerRegistration, blank=True)
score = models.CharField(max_length=50, null=True, blank=True)
walk_out = models.IntegerField(null=True, blank=True) # TODO type of WO: forfeit, injury...
lucky_loser = models.BooleanField()
lucky_loser = models.IntegerField(null=True, blank=True)
def __str__(self):
return f"{self.match.stage_name()} #{self.match.index}: {self.player_names()}"

@ -15,7 +15,7 @@ class Tournament(models.Model):
round_format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
group_stage_format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
loser_round_format = models.IntegerField(default=FederalMatchCategory.NINE_GAMES, choices=FederalMatchCategory.choices, null=True, blank=True)
bracket_sort_mode = models.IntegerField(default=0)
group_stage_sort_mode = models.IntegerField(default=0)
group_stage_count = models.IntegerField(default=0)
rank_source_date = models.DateTimeField(null=True, blank=True)
day_duration = models.IntegerField(default=0)
@ -25,17 +25,18 @@ class Tournament(models.Model):
federal_level_category = models.IntegerField(default=FederalLevelCategory.P100, choices=FederalLevelCategory.choices)
federal_age_category = models.IntegerField(default=FederalAgeCategory.SENIOR, choices=FederalAgeCategory.choices)
group_stage_court_count = models.IntegerField(null=True, blank=True)
seed_count = models.IntegerField(default=0)
#seed_count = models.IntegerField(default=0)
closed_registration_date = models.DateTimeField(null=True, blank=True)
group_stage_additional_qualified = models.IntegerField(default=0)
court_count = models.IntegerField(null=True, blank=True)
court_count = models.IntegerField(default=1)
prioritize_club_members = models.BooleanField()
qualified_per_group_stage = models.IntegerField(default=0)
teams_per_group_stage = models.IntegerField(default=0)
entry_fee = models.FloatField(default=20.0, null=True, blank=True)
payment = models.IntegerField(default=TournamentPayment.FREE, choices=TournamentPayment.choices, null=True, blank=True)
is_deleted = models.BooleanField(default=False)
is_canceled = models.BooleanField(default=False)
additional_estimation_duration = models.IntegerField(default=0)
def __str__(self):
if self.name:

@ -1,4 +1,6 @@
from rest_framework import serializers
from tournaments.models.court import Court
from tournaments.models.date_interval import DateInterval
from .models import Club, LiveMatch, TeamScore, Tournament, CustomUser, Event, Round, GroupStage, Match, TeamRegistration, PlayerRegistration, Purchase
from django.contrib.auth import password_validation
from django.utils.translation import gettext_lazy as _
@ -94,7 +96,7 @@ class TournamentSerializer(serializers.ModelSerializer):
class EventSerializer(serializers.ModelSerializer):
class Meta:
club_id = serializers.PrimaryKeyRelatedField(queryset=Club.objects.all())
#club_id = serializers.PrimaryKeyRelatedField(queryset=Club.objects.all())
model = Event
fields = '__all__'
# ['id', 'club_id', 'date', 'name', 'federal_tournament_data', 'court_count', 'tenup_id',
@ -181,3 +183,13 @@ class LiveMatchSerializer(serializers.ModelSerializer):
class Meta:
model = LiveMatch
fields = '__all__' # ['title', 'date'] # Serialize all fields of the model
class CourtSerializer(serializers.ModelSerializer):
class Meta:
model = Court
fields = '__all__'
class DateIntervalSerializer(serializers.ModelSerializer):
class Meta:
model = DateInterval
fields = '__all__'

@ -3,11 +3,13 @@ from django.http import HttpResponse
from django.utils.encoding import force_str
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.urls import reverse
from tournaments.models.court import Court
from tournaments.models.date_interval import DateInterval
from .tokens import account_activation_token
from tournaments.models import group_stage
from .serializers import ClubSerializer, TournamentSerializer, UserSerializer, ChangePasswordSerializer, EventSerializer, RoundSerializer, GroupStageSerializer, MatchSerializer, TeamScoreSerializer, TeamRegistrationSerializer, PlayerRegistrationSerializer, LiveMatchSerializer, PurchaseSerializer
from .serializers import ClubSerializer, CourtSerializer, DateIntervalSerializer, TournamentSerializer, UserSerializer, ChangePasswordSerializer, EventSerializer, RoundSerializer, GroupStageSerializer, MatchSerializer, TeamScoreSerializer, TeamRegistrationSerializer, PlayerRegistrationSerializer, LiveMatchSerializer, PurchaseSerializer
from .models import Club, Tournament, CustomUser, Event, Round, GroupStage, Match, TeamScore, TeamRegistration, PlayerRegistration, Purchase
from .models import TeamSummon
from datetime import datetime
@ -293,3 +295,11 @@ class TeamRegistrationViewSet(viewsets.ModelViewSet):
class PlayerRegistrationViewSet(viewsets.ModelViewSet):
queryset = PlayerRegistration.objects.all()
serializer_class = PlayerRegistrationSerializer
class CourtViewSet(viewsets.ModelViewSet):
queryset = Court.objects.all()
serializer_class = CourtSerializer
class DateIntervalViewSet(viewsets.ModelViewSet):
queryset = DateInterval.objects.all()
serializer_class = DateIntervalSerializer

Loading…
Cancel
Save