Skip to content

Commit 498c64a

Browse files
authored
Merge pull request #40 from 2chanhaeng/devdev
Add: Program 앱 Serializer 추가
2 parents bdc6845 + 46b9cc7 commit 498c64a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

program/serializers.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from rest_framework.serializers import ModelSerializer
2+
3+
from program.models import Proposal, ProposalCategory
4+
5+
6+
class ProposalSerializer(ModelSerializer):
7+
class Meta:
8+
model = Proposal
9+
fields = [
10+
"user",
11+
"title",
12+
"brief",
13+
"desc",
14+
"comment",
15+
"difficulty",
16+
"duration",
17+
"language",
18+
"category",
19+
"accepted",
20+
"introduction",
21+
"video_url",
22+
"slide_url",
23+
"room_num",
24+
]
25+
26+
27+
class ProposalListSerializer(ModelSerializer):
28+
class Meta:
29+
model = Proposal
30+
fields = [
31+
"title",
32+
"brief",
33+
"difficulty",
34+
"duration",
35+
"language",
36+
"category",
37+
]
38+
39+
40+
class ProposalCategorySerializer(ModelSerializer):
41+
class Meta:
42+
model = ProposalCategory
43+
fields = [
44+
"name",
45+
]

0 commit comments

Comments
 (0)