mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-16 02:16:16 +00:00
jira-15 dashboard api profile, default image, top leaderboard API
This commit is contained in:
@ -192,3 +192,33 @@ class JuniorDetailListSerializer(serializers.ModelSerializer):
|
||||
'guardian_code', 'referral_code','is_active', 'is_complete_profile', 'created_at', 'image',
|
||||
'updated_at', 'assigned_task','points', 'pending_task', 'in_progress_task', 'completed_task',
|
||||
'requested_task', 'rejected_task']
|
||||
|
||||
class JuniorProfileSerializer(serializers.ModelSerializer):
|
||||
"""junior serializer"""
|
||||
email = serializers.SerializerMethodField('get_auth')
|
||||
first_name = serializers.SerializerMethodField('get_first_name')
|
||||
last_name = serializers.SerializerMethodField('get_last_name')
|
||||
notification_count = serializers.SerializerMethodField('get_notification_count')
|
||||
|
||||
def get_auth(self, obj):
|
||||
"""user email address"""
|
||||
return obj.auth.username
|
||||
|
||||
def get_first_name(self, obj):
|
||||
"""user first name"""
|
||||
return obj.auth.first_name
|
||||
|
||||
def get_last_name(self, obj):
|
||||
"""user last name"""
|
||||
return obj.auth.last_name
|
||||
|
||||
def get_notification_count(self, obj):
|
||||
"""user email address"""
|
||||
return 0
|
||||
|
||||
class Meta(object):
|
||||
"""Meta info"""
|
||||
model = Junior
|
||||
fields = ['id', 'email', 'first_name', 'last_name', 'country_code', 'phone', 'gender', 'dob',
|
||||
'guardian_code', 'referral_code','is_active', 'is_complete_profile', 'created_at', 'image',
|
||||
'updated_at', 'notification_count']
|
||||
|
Reference in New Issue
Block a user