from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from rest_framework import serializers


class ProfileSerializer(serializers.ModelSerializer):
    url = serializers.SerializerMethodField('get_profile_url')

    class Meta:
        model = User
        fields = ('id', 'url', 'username')

    def get_profile_url(self, obj):
        return reverse('member_profile', args=(obj.id,))

from django.contrib.auth.models import User
# from django.core.urlresolvers import reverse
from rest_framework import serializers


class ProfileSerializer(serializers.ModelSerializer):
    # url = serializers.SerializerMethodField('get_profile_url')
    message = serializers.SerializerMethodField('get_message')

    class Meta:
        model = User
        # fields = ('id', 'url', 'username')
        fields = ('message',)

    # def get_profile_url(self, obj):
    #     return reverse('member_profile', args=(obj.id,))

    def get_message(self, obj):
        return 'profiles are not yet implemented'

Make /api/profile return no private data
Make /api/profile return no private data

  from django.contrib.auth.models import User
- from django.core.urlresolvers import reverse
+ # from django.core.urlresolvers import reverse
  from rest_framework import serializers
  
  
  class ProfileSerializer(serializers.ModelSerializer):
-     url = serializers.SerializerMethodField('get_profile_url')
+     # url = serializers.SerializerMethodField('get_profile_url')
+     message = serializers.SerializerMethodField('get_message')
  
      class Meta:
          model = User
-         fields = ('id', 'url', 'username')
+         # fields = ('id', 'url', 'username')
+         fields = ('message',)
  
-     def get_profile_url(self, obj):
+     # def get_profile_url(self, obj):
-         return reverse('member_profile', args=(obj.id,))
+     #     return reverse('member_profile', args=(obj.id,))
  
+     def get_message(self, obj):
+         return 'profiles are not yet implemented'
+ 
Make /api/profile return no private data
## Code Before:
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from rest_framework import serializers


class ProfileSerializer(serializers.ModelSerializer):
    url = serializers.SerializerMethodField('get_profile_url')

    class Meta:
        model = User
        fields = ('id', 'url', 'username')

    def get_profile_url(self, obj):
        return reverse('member_profile', args=(obj.id,))

## Instruction:
Make /api/profile return no private data
## Code After:
from django.contrib.auth.models import User
# from django.core.urlresolvers import reverse
from rest_framework import serializers


class ProfileSerializer(serializers.ModelSerializer):
    # url = serializers.SerializerMethodField('get_profile_url')
    message = serializers.SerializerMethodField('get_message')

    class Meta:
        model = User
        # fields = ('id', 'url', 'username')
        fields = ('message',)

    # def get_profile_url(self, obj):
    #     return reverse('member_profile', args=(obj.id,))

    def get_message(self, obj):
        return 'profiles are not yet implemented'
