mirror of
https://github.com/AudebertAdrien/ft_transcendence.git
synced 2026-02-04 03:30:26 +01:00
big prob
This commit is contained in:
parent
41c10ffe13
commit
80be17119a
@ -1,4 +1,4 @@
|
||||
# Generated by Django 5.0.7 on 2024-07-30 19:44
|
||||
# Generated by Django 5.0.7 on 2024-07-31 13:42
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
@ -48,7 +48,7 @@ class Migration(migrations.Migration):
|
||||
('score_player2', models.PositiveSmallIntegerField()),
|
||||
('nbr_ball_touch_p1', models.PositiveIntegerField()),
|
||||
('nbr_ball_touch_p2', models.PositiveIntegerField()),
|
||||
('duration', models.DurationField()),
|
||||
('duration', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True)),
|
||||
('date', models.DateField(auto_now_add=True)),
|
||||
('is_tournoi', models.BooleanField()),
|
||||
('player1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='match_as_player1', to='game.player')),
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 5.0.7 on 2024-07-31 13:17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('game', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='match',
|
||||
name='duration',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True),
|
||||
),
|
||||
]
|
||||
@ -1,68 +0,0 @@
|
||||
# Generated by Django 5.0.7 on 2024-07-24 16:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('game', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='best_score',
|
||||
field=models.PositiveSmallIntegerField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='m_duration',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='m_nbr_ball_touch',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='m_score_adv_match',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='m_score_match',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='num_participated_tournaments',
|
||||
field=models.PositiveSmallIntegerField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='num_won_tournaments',
|
||||
field=models.PositiveSmallIntegerField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='p_win',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='total_duration',
|
||||
field=models.DurationField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='total_match',
|
||||
field=models.PositiveSmallIntegerField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='total_win',
|
||||
field=models.PositiveSmallIntegerField(default=0),
|
||||
),
|
||||
]
|
||||
@ -3,26 +3,6 @@ from django.core.exceptions import ValidationError
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.db.models import Max, Sum, F
|
||||
from datetime import timedelta
|
||||
<<<<<<< HEAD
|
||||
|
||||
def endfortheouche(p1, p2, s_p1, s_p2, winner, bt_p1, bt_p2, dur, is_tournoi, name_tournament) :
|
||||
#If he doesn't exist, create player p1
|
||||
if not Player.objects.filter(name=p1).exist():
|
||||
create_player(p1)
|
||||
|
||||
#If he doesn't exist, create player p2
|
||||
if not Player.objects.filter(name=p2).exist():
|
||||
create_player(p2)
|
||||
|
||||
#create Match
|
||||
create_match(p1, p2, s_p1, s_p2, bt_p1, bt_p2, dur, is_tournoi, name_tournamenttournoi)
|
||||
|
||||
#Update data p1 et p2
|
||||
uptdate_player_statistics(p1)
|
||||
uptdate_player_statistics(p2)
|
||||
|
||||
|
||||
=======
|
||||
from channels.db import database_sync_to_async
|
||||
|
||||
async def endfortheouche(p1, p2, s_p1, s_p2, bt_p1, bt_2, dur, is_tournoi, name_tournament):
|
||||
@ -46,7 +26,6 @@ async def endfortheouche(p1, p2, s_p1, s_p2, bt_p1, bt_2, dur, is_tournoi, name_
|
||||
await uptdate_player_statistics(p2)
|
||||
|
||||
@database_sync_to_async
|
||||
>>>>>>> 067f24f5b87b0db75b90d5a86f47b30d1509ba99
|
||||
def create_player(
|
||||
name,
|
||||
total_match=0,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user