Skip to content

Commit f79660a

Browse files
committed
Add program model
1 parent cb0f2de commit f79660a

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

program/migrations/0003_program.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated by Django 4.1.5 on 2023-05-24 13:39
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('program', '0002_alter_proposal_options_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.CreateModel(
14+
name='Program',
15+
fields=[
16+
('id', models.UUIDField(primary_key=True, serialize=False)),
17+
('host', models.CharField(max_length=100)),
18+
('title', models.CharField(max_length=100)),
19+
('short_desc', models.CharField(max_length=1000)),
20+
('desc', models.CharField(max_length=4000)),
21+
('room', models.CharField(blank=True, choices=[('101', '101'), ('102', '102'), ('103', '103'), ('104', '104'), ('105', '105'), ('201', '201'), ('202', '202'), ('203', '203')], max_length=15, null=True)),
22+
('capacity', models.IntegerField(blank=True, help_text='최대 참가 가능 인원 수', null=True)),
23+
('start_at', models.DateTimeField(blank=True, null=True)),
24+
('end_at', models.DateTimeField(blank=True, null=True)),
25+
('program_type', models.CharField(choices=[('CONFERENCE', '컨퍼런스'), ('TUTORIAL', '튜토리얼'), ('SPRINT', '스프린트')], max_length=30)),
26+
],
27+
),
28+
]

program/models.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,45 @@ class Meta:
9595

9696
def __str__(self):
9797
return self.title
98+
99+
100+
CONFERENCE = "CONFERENCE"
101+
TUTORIAL = "TUTORIAL"
102+
SPRINT = "SPRINT"
103+
104+
105+
class Program(models.Model):
106+
id = models.UUIDField(primary_key=True)
107+
host = models.CharField(max_length=100) # TODO User로?
108+
title = models.CharField(max_length=100)
109+
short_desc = models.CharField(max_length=1000)
110+
desc = models.CharField(max_length=4000)
111+
room = models.CharField(
112+
max_length=15,
113+
null=True,
114+
blank=True,
115+
choices=(
116+
("101", "101"),
117+
("102", "102"),
118+
("103", "103"),
119+
("104", "104"),
120+
("105", "105"),
121+
("201", "201"),
122+
("202", "202"),
123+
("203", "203"), # TODO 2층 호실 추가 필요
124+
),
125+
)
126+
capacity = models.IntegerField(null=True, blank=True, help_text="최대 참가 가능 인원 수")
127+
start_at = models.DateTimeField(null=True, blank=True)
128+
end_at = models.DateTimeField(null=True, blank=True)
129+
program_type = models.CharField(
130+
max_length=30,
131+
choices=(
132+
(CONFERENCE, "컨퍼런스"),
133+
(TUTORIAL, "튜토리얼"),
134+
(SPRINT, "스프린트"),
135+
),
136+
)
137+
138+
def __str__(self):
139+
return self.title

0 commit comments

Comments
 (0)