mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 22:07:10 +00:00
Merge branch 'master' of gitlab.prodcontest.ru:team-15/project
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from apps.competition.models import Competition
|
||||
|
||||
|
||||
@admin.register(Competition)
|
||||
class CompetitionAdmin(admin.ModelAdmin):
|
||||
list_display = ("title", "end_date", "type",)
|
||||
search_fields = ("title", "description",)
|
||||
list_filter = ("type", "participation_type",)
|
||||
@@ -4,3 +4,4 @@ from django.apps import AppConfig
|
||||
class CompetitionsConfig(AppConfig):
|
||||
name = "apps.competition"
|
||||
label = "competition"
|
||||
verbose_name = "Соревнование"
|
||||
|
||||
@@ -8,11 +8,11 @@ from apps.user.models import User
|
||||
|
||||
class Competition(BaseModel):
|
||||
class CompetitionType(models.TextChoices):
|
||||
SOLO = "solo"
|
||||
SOLO = "solo", "Индивидуальный"
|
||||
|
||||
class CompetitionParticipationType(models.TextChoices):
|
||||
EDU = "edu"
|
||||
COMPETITIVE = "competitive"
|
||||
EDU = "edu", "Образовательный"
|
||||
COMPETITIVE = "competitive", "Соревновательный"
|
||||
|
||||
title = models.CharField(max_length=100, verbose_name="Название")
|
||||
description = models.TextField(verbose_name="Описание")
|
||||
@@ -35,7 +35,11 @@ class Competition(BaseModel):
|
||||
choices=CompetitionParticipationType.choices,
|
||||
verbose_name="Тип соревнования",
|
||||
)
|
||||
participants = models.ManyToManyField(User, related_name="participants")
|
||||
participants = models.ManyToManyField(User, related_name="participants", blank=True,
|
||||
editable=False)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
class Meta:
|
||||
verbose_name = "соревнование"
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.models import Group, User
|
||||
|
||||
admin.site.unregister(Group)
|
||||
admin.site.unregister(User)
|
||||
@@ -227,7 +227,7 @@ FIRST_DAY_OF_WEEK = 1
|
||||
|
||||
FORMAT_MODULE_PATH = None
|
||||
|
||||
LANGUAGE_CODE = env("DJANGO_LANGUAGE_CODE", default="en-us")
|
||||
LANGUAGE_CODE = env("DJANGO_LANGUAGE_CODE", default="ru-ru")
|
||||
|
||||
LANGUAGES = [("en", _("English")), ("ru", _("Russian"))]
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ dependencies = [
|
||||
"psycopg2-binary>=2.9.10",
|
||||
"pydantic>=2.10.5",
|
||||
"pyjwt>=2.10.1",
|
||||
"python-gettext>=5.0",
|
||||
"python-json-logger>=3.2.1",
|
||||
"pytz>=2024.2",
|
||||
"redis>=5.2.1",
|
||||
|
||||
Reference in New Issue
Block a user