mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 13:17:10 +00:00
add competitions model
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class CompetitionsConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'apps.competitions'
|
||||||
|
label = 'competitions'
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
from apps.core.models import BaseModel
|
||||||
|
|
||||||
|
|
||||||
|
class CompetitionType(models.TextChoices):
|
||||||
|
SOLO = "solo"
|
||||||
|
|
||||||
|
|
||||||
|
class CompetitionPartipicationType(models.TextChoices):
|
||||||
|
EDU = "edu"
|
||||||
|
COMPETITIVE = "competitive"
|
||||||
|
|
||||||
|
|
||||||
|
class Competition(BaseModel):
|
||||||
|
title = models.CharField(max_length=100, verbose_name="Название")
|
||||||
|
description = models.TextField(verbose_name="Описание")
|
||||||
|
image_url = models.FileField(verbose_name="Изображение соревнования")
|
||||||
|
due_to = models.DateTimeField(verbose_name="Дедлайн участия")
|
||||||
|
|
||||||
|
type = models.CharField(max_length=10, choices=CompetitionType.choices,
|
||||||
|
verbose_name="Тип участия")
|
||||||
|
participation_type = models.CharField(max_length=10, choices=CompetitionPartipicationType.choices,
|
||||||
|
verbose_name="Тип соревнования")
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = "соревнование"
|
||||||
|
verbose_name_plural = "соревнования"
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# Generated by Django 5.1.6 on 2025-02-28 20:46
|
||||||
|
|
||||||
|
import uuid
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='User',
|
||||||
|
fields=[
|
||||||
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||||
|
('email', models.EmailField(max_length=254, unique=True, verbose_name='Почта')),
|
||||||
|
('username', models.SlugField(unique=True, verbose_name='Юзернейм')),
|
||||||
|
('password', models.TextField(verbose_name='Пароль')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name': 'пользователь',
|
||||||
|
'verbose_name_plural': 'пользователи',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user