__author__ = ['elsabakiu', 'dmorina', 'neilthemathguy', 'megha']

from crowdsourcing import models
from datetime import datetime
from rest_framework import serializers
import json

class WorkerSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Worker
        


class SkillSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Skill
        fields = ('name', 'description', 'verified', 'deleted', 'created_timestamp', 'last_updated')
        read_only_fields = ('created_timestamp', 'last_updated')


class WorkerSkillSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.WorkerSkill
        fields = ('worker', 'skill', 'level', 'verified', 'created_timestamp', 'last_updated')
        read_only_fields = ('worker', 'created_timestamp', 'last_updated')


class TaskWorkerSerializer (serializers.ModelSerializer):
    class Meta:
        model = models.TaskWorker
        fields = ('task', 'worker', 'created_timestamp', 'last_updated')
        read_only_fields = ('task', 'worker', 'created_timestamp', 'last_updated')


class TaskWorkerResultSerializer (serializers.ModelSerializer):
    class Meta:
        model = models.TaskWorkerResult
        fields = ('task_worker', 'template_item', 'status', 'created_timestamp', 'last_updated')
        read_only_fields = ('task_worker', 'template_item', 'created_timestamp', 'last_updated')


class WorkerModuleApplicationSerializer (serializers.ModelSerializer):
    class Meta:
        model = models.WorkerModuleApplication
        fields = ('worker', 'module', 'status', 'created_timestamp', 'last_updated')
        read_only_fields = ('worker', 'module', 'created_timestamp', 'last_updated')
        
class TaskSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Task        
        fields = ( 'module', 'statuses','status', 'deleted', 'created_timestamp')
        
class QualificationSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Qualification

class CurrencySerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Currency       

__author__ = ['elsabakiu', 'dmorina', 'neilthemathguy', 'megha']

from crowdsourcing import models
from datetime import datetime
from rest_framework import serializers
import json

class WorkerSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Worker
        


class SkillSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Skill
        fields = ('name', 'description', 'verified', 'deleted', 'created_timestamp', 'last_updated')
        read_only_fields = ('created_timestamp', 'last_updated')


class WorkerSkillSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.WorkerSkill
        fields = ('worker', 'skill', 'level', 'verified', 'created_timestamp', 'last_updated')
        read_only_fields = ('worker', 'created_timestamp', 'last_updated')


class TaskWorkerSerializer (serializers.ModelSerializer):
    class Meta:
        model = models.TaskWorker
        fields = ('task', 'worker', 'created_timestamp', 'last_updated')
        read_only_fields = ('task', 'worker', 'created_timestamp', 'last_updated')


class TaskWorkerResultSerializer (serializers.ModelSerializer):
    class Meta:
        model = models.TaskWorkerResult
        fields = ('task_worker', 'template_item', 'status', 'created_timestamp', 'last_updated')
        read_only_fields = ('task_worker', 'template_item', 'created_timestamp', 'last_updated')


class WorkerModuleApplicationSerializer (serializers.ModelSerializer):
    class Meta:
        model = models.WorkerModuleApplication
        fields = ('worker', 'module', 'status', 'created_timestamp', 'last_updated')
        read_only_fields = ('worker', 'module', 'created_timestamp', 'last_updated')
        
class TaskSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Task        
        fields = ( 'module', 'statuses','status', 'deleted', 'created_timestamp')
        


      

Update worker.py