title: How to change field name in serializers in django
body: <p>I have a field country_id and country_name and i want to change the name for both fields in Django rest Framework</p>
  
  <p>write now I'm getting this data </p>
  
  <pre><code>{
    "data": [
      {
        "country_id": 1,
        "country_name": "Afghanistan"
      },
      {
        "country_id": 2,
        "country_name": "Aland Islands"
      } 
    ]
  }
  </code></pre>
  
  <p>I have change in serializers.py file but didn't work for me</p>
  
  <p>serializers.py</p>
  
  <pre><code>class CountrySerializer(serializers.ModelSerializer):
      name = serializers.SerializerMethodField('country_name')
      class Meta:
          model = Country
          fields = ('country_id', 'name')
  </code></pre>
  
  <p>In model </p>
  
  <pre><code>class Country(models.Model):
      country_id = models.AutoField(primary_key = True)
      country_name = models.CharField(max_length = 128)
  
      class Meta:
          db_table = 'countries'
  </code></pre>
  
  <p>I want this data </p>
  
  <pre><code> {
        "data": [
          {
            "id": 1,
            "name": "Afghanistan"
          },
          {
            "id": 2,
            "name": "Aland Islands"
          }
        ]
      }
  </code></pre>
  
  <p>Geting this error: AttributeError at /v1/location/countries/
  'CountrySerializer' object has no attribute 'country_name'</p>