mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 03:57:09 +00:00
add basic admin for task
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from apps.competition.models import Competition
|
||||
from apps.task.admin import CompetitionTaskInline
|
||||
|
||||
|
||||
@admin.register(Competition)
|
||||
@@ -8,3 +9,4 @@ class CompetitionAdmin(admin.ModelAdmin):
|
||||
list_display = ("title", "end_date", "type",)
|
||||
search_fields = ("title", "description",)
|
||||
list_filter = ("type", "participation_type",)
|
||||
inlines = [CompetitionTaskInline]
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
# Generated by Django 5.1.6 on 2025-03-01 12:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('competition', '0001_initial'),
|
||||
('task', '0001_initial'),
|
||||
('user', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='competition',
|
||||
name='tasks',
|
||||
field=models.ManyToManyField(blank=True, related_name='tasks', to='task.competitiontask'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='competition',
|
||||
name='participants',
|
||||
field=models.ManyToManyField(blank=True, editable=False, related_name='participants', to='user.user'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='competition',
|
||||
name='participation_type',
|
||||
field=models.CharField(choices=[('edu', 'Образовательный'), ('competitive', 'Соревновательный')], max_length=11, verbose_name='Тип соревнования'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='competition',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('solo', 'Индивидуальный')], max_length=10, verbose_name='Тип участия'),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user