__author__ = 'Alok'
from django.contrib.auth.models import User

from rest_framework import serializers, permissions

from apps.notes.models import Note


class NoteSerializer(serializers.ModelSerializer):
    owner = serializers.ReadOnlyField(source='owner.username')

    class Meta:
        model = Note
        fields = ('id', 'title', 'code', 'created', 'owner')


class UserSerializer(serializers.ModelSerializer):
    notes = serializers.PrimaryKeyRelatedField(many=True, queryset=Note.objects.all())

    class Meta:
        model = User
        fields = ('id', 'username', 'notes')
72aa3bbc804addae3da2af3f2e226d779c0a2d15
<mask token>


class NoteSerializer(serializers.ModelSerializer):
    <mask token>


    class Meta:
        model = Note
        fields = 'id', 'title', 'code', 'created', 'owner'


class UserSerializer(serializers.ModelSerializer):
    notes = serializers.PrimaryKeyRelatedField(many=True, queryset=Note.
        objects.all())


    class Meta:
        model = User
        fields = 'id', 'username', 'notes'

<mask token>


class NoteSerializer(serializers.ModelSerializer):
    owner = serializers.ReadOnlyField(source='owner.username')


    class Meta:
        model = Note
        fields = 'id', 'title', 'code', 'created', 'owner'


class UserSerializer(serializers.ModelSerializer):
    notes = serializers.PrimaryKeyRelatedField(many=True, queryset=Note.
        objects.all())


    class Meta:
        model = User
        fields = 'id', 'username', 'notes'

__author__ = 'Alok'
<mask token>


class NoteSerializer(serializers.ModelSerializer):
    owner = serializers.ReadOnlyField(source='owner.username')


    class Meta:
        model = Note
        fields = 'id', 'title', 'code', 'created', 'owner'


class UserSerializer(serializers.ModelSerializer):
    notes = serializers.PrimaryKeyRelatedField(many=True, queryset=Note.
        objects.all())


    class Meta:
        model = User
        fields = 'id', 'username', 'notes'

__author__ = 'Alok'
from django.contrib.auth.models import User
from rest_framework import serializers, permissions
from apps.notes.models import Note


class NoteSerializer(serializers.ModelSerializer):
    owner = serializers.ReadOnlyField(source='owner.username')


    class Meta:
        model = Note
        fields = 'id', 'title', 'code', 'created', 'owner'


class UserSerializer(serializers.ModelSerializer):
    notes = serializers.PrimaryKeyRelatedField(many=True, queryset=Note.
        objects.all())


    class Meta:
        model = User
        fields = 'id', 'username', 'notes'

__author__ = 'Alok'
from django.contrib.auth.models import User

from rest_framework import serializers, permissions

from apps.notes.models import Note


class NoteSerializer(serializers.ModelSerializer):
    owner = serializers.ReadOnlyField(source='owner.username')

    class Meta:
        model = Note
        fields = ('id', 'title', 'code', 'created', 'owner')


class UserSerializer(serializers.ModelSerializer):
    notes = serializers.PrimaryKeyRelatedField(many=True, queryset=Note.objects.all())

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