rewrite migrations; fix comptitions tests

This commit is contained in:
Timur
2025-03-02 02:52:22 +03:00
parent 923fb4d509
commit bfe49daa4c
12 changed files with 76 additions and 148 deletions
@@ -1,4 +1,4 @@
# Generated by Django 5.1.6 on 2025-03-01 22:16
# Generated by Django 5.1.6 on 2025-03-01 23:48
import django.db.models.deletion
import uuid
@@ -10,7 +10,7 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('user', '0002_alter_user_email_alter_user_password_and_more'),
('user', '0001_initial'),
]
operations = [
@@ -27,4 +27,16 @@ class Migration(migrations.Migration):
'verbose_name_plural': 'команды',
},
),
migrations.CreateModel(
name='TeamInvite',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('link', models.UUIDField(verbose_name='инвайт')),
('team', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='team.team', verbose_name='команда')),
],
options={
'verbose_name': 'приглашение',
'verbose_name_plural': 'приглашения',
},
),
]
+12
View File
@@ -1,3 +1,5 @@
from uuid import uuid4
from django.db import models
from apps.core.models import BaseModel
@@ -17,3 +19,13 @@ class Team(BaseModel):
class Meta:
verbose_name = "команда"
verbose_name_plural = "команды"
class TeamInvite(BaseModel):
team = models.ForeignKey(Team, on_delete=models.CASCADE,
verbose_name="команда")
link = models.UUIDField(verbose_name="инвайт")
class Meta:
verbose_name = "приглашение"
verbose_name_plural = "приглашения"