File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 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+ ]
You can’t perform that action at this time.
0 commit comments