from rest_framework import serializers

from db.base.models import Satellite, Transponder


class SatelliteSerializer(serializers.ModelSerializer):
    class Meta:
        model = Satellite


class TransponderSerializer(serializers.ModelSerializer):
    norad = serializers.SerializerMethodField()

    class Meta:
        model = Transponder
        fields = ('uuid', 'description', 'alive', 'uplink_low', 'uplink_high',
                  'downlink_low', 'downlink_high', 'mode', 'invert',
                  'baud', 'norad')

    def get_norad(self, obj):
        return obj.satellite.norad_cat_id

from rest_framework import serializers

from db.base.models import Satellite, Transponder


class SatelliteSerializer(serializers.ModelSerializer):
    class Meta:
        model = Satellite


class TransponderSerializer(serializers.ModelSerializer):
    norad_cat_id = serializers.SerializerMethodField()

    class Meta:
        model = Transponder
        fields = ('uuid', 'description', 'alive', 'uplink_low', 'uplink_high',
                  'downlink_low', 'downlink_high', 'mode', 'invert',
                  'baud', 'norad_cat_id')

    def get_norad_cat_id(self, obj):
        return obj.satellite.norad_cat_id

Change norad API field to proper name
Change norad API field to proper name

  from rest_framework import serializers
  
  from db.base.models import Satellite, Transponder
  
  
  class SatelliteSerializer(serializers.ModelSerializer):
      class Meta:
          model = Satellite
  
  
  class TransponderSerializer(serializers.ModelSerializer):
-     norad = serializers.SerializerMethodField()
+     norad_cat_id = serializers.SerializerMethodField()
  
      class Meta:
          model = Transponder
          fields = ('uuid', 'description', 'alive', 'uplink_low', 'uplink_high',
                    'downlink_low', 'downlink_high', 'mode', 'invert',
-                   'baud', 'norad')
+                   'baud', 'norad_cat_id')
  
-     def get_norad(self, obj):
+     def get_norad_cat_id(self, obj):
          return obj.satellite.norad_cat_id
  
Change norad API field to proper name
## Code Before:
from rest_framework import serializers

from db.base.models import Satellite, Transponder


class SatelliteSerializer(serializers.ModelSerializer):
    class Meta:
        model = Satellite


class TransponderSerializer(serializers.ModelSerializer):
    norad = serializers.SerializerMethodField()

    class Meta:
        model = Transponder
        fields = ('uuid', 'description', 'alive', 'uplink_low', 'uplink_high',
                  'downlink_low', 'downlink_high', 'mode', 'invert',
                  'baud', 'norad')

    def get_norad(self, obj):
        return obj.satellite.norad_cat_id

## Instruction:
Change norad API field to proper name
## Code After:
from rest_framework import serializers

from db.base.models import Satellite, Transponder


class SatelliteSerializer(serializers.ModelSerializer):
    class Meta:
        model = Satellite


class TransponderSerializer(serializers.ModelSerializer):
    norad_cat_id = serializers.SerializerMethodField()

    class Meta:
        model = Transponder
        fields = ('uuid', 'description', 'alive', 'uplink_low', 'uplink_high',
                  'downlink_low', 'downlink_high', 'mode', 'invert',
                  'baud', 'norad_cat_id')

    def get_norad_cat_id(self, obj):
        return obj.satellite.norad_cat_id
