-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserializers.py
102 lines (81 loc) · 2.51 KB
/
serializers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
from rest_framework.serializers import ModelSerializer
from app.models import *
from rest_framework import serializers
class UserSerializer(ModelSerializer):
class Meta:
model = User
fields = ['first_name', 'last_name', 'email', 'password']
extra_kwargs = {'password': {'write_only': True}}
def create(self, validated_data):
user = User(
first_name=validated_data['first_name'],
last_name=validated_data['last_name'],
email=validated_data['email']
)
user.set_password(validated_data['password'])
user.save()
return user
class userProfileSerializer(ModelSerializer):
class Meta:
model = User
fields = ('first_name', 'last_name')
class ResumeSerializer(ModelSerializer):
class Meta:
model = Personal_Details
fields = '__all__'
class skillSerializer(ModelSerializer):
class Meta:
model = Skills
fields = '__all__'
class experienceSerializer(ModelSerializer):
class Meta:
model = Experience
fields = '__all__'
class projectSerializer(ModelSerializer):
class Meta:
model = Project
fields = '__all__'
class educationSerializer(ModelSerializer):
class Meta:
model = Education
fields = '__all__'
class languageSerializer(ModelSerializer):
class Meta:
model = Language
fields = '__all__'
class referenceSerializer(ModelSerializer):
class Meta:
model = Reference
fields = '__all__'
class awardSerializer(ModelSerializer):
class Meta:
model = Award
fields = '__all__'
class organisationSerializer(ModelSerializer):
class Meta:
model = Organisation
fields = '__all__'
class interestSerializer(ModelSerializer):
class Meta:
model = Interest
fields = '__all__'
class certificateSerializer(ModelSerializer):
class Meta:
model = Certificate
fields = '__all__'
class publicationSerializer(ModelSerializer):
class Meta:
model = Publication
fields = '__all__'
class feedbackSerializer(ModelSerializer):
class Meta:
model = Feedback
exclude = ('time_created',)
class levelsSerializer(ModelSerializer):
class Meta:
model = Levels
fields = '__all__'
class profileSerializer(ModelSerializer):
class Meta:
model = Profile
fields = '__all__'