Skip to content

Commit 4cca276

Browse files
committed
update: 후원사 모집에 필요한 필드 추가
1 parent 32afbbe commit 4cca276

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Generated by Django 4.1.5 on 2023-02-11 15:16
2+
3+
from django.db import migrations, models
4+
import sponsor.models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
("sponsor", "0001_initial"),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name="sponsor",
16+
name="bank_book_file",
17+
field=models.FileField(
18+
blank=True,
19+
help_text="후원사 사업자 등록증 스캔본입니다. 세금 계산서 발급에 사용됩니다.",
20+
null=True,
21+
upload_to=sponsor.models.bank_book_file_upload_to,
22+
),
23+
),
24+
migrations.AddField(
25+
model_name="sponsor",
26+
name="manager_tel",
27+
field=models.CharField(
28+
default="",
29+
help_text="메일에 회신이 없거나, 긴급한 건의 경우, 문자나 유선으로 안내드릴 수 있습니다. 후원 담당자의 유선 연락처를 입력해주십시오.",
30+
max_length=20,
31+
),
32+
),
33+
migrations.AlterField(
34+
model_name="sponsor",
35+
name="business_registration_file",
36+
field=models.FileField(
37+
blank=True,
38+
default=None,
39+
help_text="후원사 사업자 등록증 스캔본입니다. 세금 계산서 발급에 사용됩니다.",
40+
null=True,
41+
upload_to=sponsor.models.registration_file_upload_to,
42+
),
43+
),
44+
]

sponsor/models.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def __str__(self):
4949
def registration_file_upload_to(instance, filename):
5050
return f"sponsor/business_registration/{instance.id}/{filename}"
5151

52+
def bank_book_file_upload_to(instance, filename):
53+
return f"sponsor/bank_book/{instance.id}/{filename}"
5254

5355
def logo_image_upload_to(instance, filename):
5456
return f"sponsor/logo/{instance.id}/{filename}"
@@ -89,6 +91,11 @@ class Meta:
8991
max_length=100,
9092
help_text="입력하신 메일로 후원과 관련된 안내 메일이나 문의를 보낼 예정입니다. 후원 담당자의 이메일 주소를 입력해주십시오.",
9193
)
94+
manager_tel = models.CharField(
95+
max_length=20,
96+
default="",
97+
help_text="메일에 회신이 없거나, 긴급한 건의 경우, 문자나 유선으로 안내드릴 수 있습니다. 후원 담당자의 유선 연락처를 입력해주십시오.",
98+
)
9299
manager_id = models.ForeignKey(
93100
User,
94101
null=True,
@@ -106,9 +113,16 @@ class Meta:
106113
business_registration_file = models.FileField(
107114
null=True,
108115
blank=True,
116+
default=None,
109117
upload_to=registration_file_upload_to,
110118
help_text="후원사 사업자 등록증 스캔본입니다. 세금 계산서 발급에 사용됩니다.",
111119
)
120+
bank_book_file = models.FileField(
121+
null=True,
122+
blank=True,
123+
upload_to=bank_book_file_upload_to,
124+
help_text="후원사 사업자 등록증 스캔본입니다. 세금 계산서 발급에 사용됩니다.",
125+
)
112126
url = models.CharField(
113127
max_length=255,
114128
null=True,

sponsor/serializers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ class Meta:
1111
"desc", # 국문/영문 모두 한 필드에 담아 제공하는 것으로 결정
1212
"manager_name", # 상세에만 포함되는 필드
1313
"manager_email", # 상세에만 포함되는 필드
14+
"manager_tel", # 상세에만 포함되는 필드
1415
"business_registration_number", # 상세에만 포함되는 필드
1516
"business_registration_file", # 상세에만 포함되는 필드
17+
"bank_book_file", # 상세에만 포함되는 필드
1618
"url",
1719
"logo_image",
1820
"level",

0 commit comments

Comments
 (0)