|
| 1 | +from django.contrib.auth import get_user_model |
| 2 | +from django.db import models |
| 3 | + |
| 4 | +User = get_user_model() |
| 5 | + |
| 6 | + |
| 7 | +class ProgramCategory(models.Model): |
| 8 | + name = models.CharField(max_length=100, db_index=True) |
| 9 | + visible = models.BooleanField(default=True) |
| 10 | + created_at = models.DateTimeField(auto_now_add=True) |
| 11 | + updated_at = models.DateTimeField(auto_now=True) |
| 12 | + |
| 13 | + def __str__(self): |
| 14 | + return self.name |
| 15 | + |
| 16 | + |
| 17 | +class Proposal(models.Model): |
| 18 | + user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True) |
| 19 | + |
| 20 | + title = models.CharField(max_length=255) |
| 21 | + brief = models.TextField(max_length=1000, help_text="리뷰용: 발표에 대한 간단한 설명.") |
| 22 | + desc = models.TextField(max_length=4000, help_text="리뷰용: 발표에 대한 자세한 설명") |
| 23 | + comment = models.TextField( |
| 24 | + max_length=4000, null=True, blank=True, help_text="리뷰용: 파준위에게 전하고 싶은 말" |
| 25 | + ) |
| 26 | + |
| 27 | + difficulty = models.CharField( |
| 28 | + max_length=1, |
| 29 | + choices=( |
| 30 | + ("B", "Beginner"), |
| 31 | + ("I", "Intermediate"), |
| 32 | + ("E", "Experienced"), |
| 33 | + ), |
| 34 | + ) |
| 35 | + |
| 36 | + duration = models.CharField( |
| 37 | + max_length=1, |
| 38 | + choices=( |
| 39 | + ("S", "25min"), |
| 40 | + ("L", "40min"), |
| 41 | + ), |
| 42 | + ) |
| 43 | + |
| 44 | + language = models.CharField( |
| 45 | + max_length=1, |
| 46 | + choices=( |
| 47 | + ("", "---------"), |
| 48 | + ("K", "Korean"), |
| 49 | + ("E", "English"), |
| 50 | + ), |
| 51 | + default="", |
| 52 | + ) |
| 53 | + |
| 54 | + category = models.ForeignKey( |
| 55 | + ProgramCategory, on_delete=models.SET_DEFAULT, null=True, blank=True, default=14 |
| 56 | + ) |
| 57 | + accepted = models.BooleanField(default=False) |
| 58 | + introduction = models.TextField( |
| 59 | + max_length=2000, |
| 60 | + null=True, |
| 61 | + blank=True, |
| 62 | + help_text="발표 소개 페이지에 들어가는 내용입니다. 변경 사항은 최대 60분 이내에 적용됩니다.", |
| 63 | + ) |
| 64 | + video_url = models.CharField( |
| 65 | + max_length=255, null=True, blank=True, help_text="발표 영상 URL" |
| 66 | + ) |
| 67 | + slide_url = models.CharField( |
| 68 | + max_length=255, null=True, blank=True, help_text="발표 자료 URL" |
| 69 | + ) |
| 70 | + track_num = models.IntegerField(null=True, blank=True, help_text="트랙 번호") |
| 71 | + |
| 72 | + def __str__(self): |
| 73 | + return self.title |
0 commit comments