from .models import Category, Keyword
from rest_framework import serializers


class CategorySerializer(serializers.ModelSerializer):
    class Meta(object):
        model = Category
        fields = ('pk', 'name', 'weight', 'comment_required')


class KeywordSerializer(serializers.ModelSerializer):
    class Meta(object):
        model = Keyword
        fields = ('pk', 'name')

from .models import Category, Keyword
from rest_framework import serializers


class CategorySerializer(serializers.ModelSerializer):
    class Meta(object):
        model = Category
        fields = ('pk', 'name', 'comment_required')


class KeywordSerializer(serializers.ModelSerializer):
    class Meta(object):
        model = Keyword
        fields = ('pk', 'name')

Remove weight from category serializer
Remove weight from category serializer

  from .models import Category, Keyword
  from rest_framework import serializers
  
  
  class CategorySerializer(serializers.ModelSerializer):
      class Meta(object):
          model = Category
-         fields = ('pk', 'name', 'weight', 'comment_required')
+         fields = ('pk', 'name', 'comment_required')
  
  
  class KeywordSerializer(serializers.ModelSerializer):
      class Meta(object):
          model = Keyword
          fields = ('pk', 'name')
  
Remove weight from category serializer
## Code Before:
from .models import Category, Keyword
from rest_framework import serializers


class CategorySerializer(serializers.ModelSerializer):
    class Meta(object):
        model = Category
        fields = ('pk', 'name', 'weight', 'comment_required')


class KeywordSerializer(serializers.ModelSerializer):
    class Meta(object):
        model = Keyword
        fields = ('pk', 'name')

## Instruction:
Remove weight from category serializer
## Code After:
from .models import Category, Keyword
from rest_framework import serializers


class CategorySerializer(serializers.ModelSerializer):
    class Meta(object):
        model = Category
        fields = ('pk', 'name', 'comment_required')


class KeywordSerializer(serializers.ModelSerializer):
    class Meta(object):
        model = Keyword
        fields = ('pk', 'name')
