@@ -0,0 +1,1392 @@
+from rest_framework import serializers%0Afrom snippets.models import Snippet, LANGUAGE_CHOICES, STYLE_CHOICES%0A%0A%0Aclass SnippetSerializer(serializers.Serializer):%0A    %22%22%22Create a class to serialize snippets.%22%22%22%0A    id = serializers.IntegerField(read_only=True)%0A    title = serializers.CharField(required=False, allow_blank=True, max_length=100)%0A    code = serializers.CharField(style=%7B'base_template': 'textarea.html'%7D)%0A    linenos = serializers.BooleanField(required=False)%0A    language = serializers.ChoiceField(choices=LANGUAGE_CHOICES, default='python')%0A    style = serializers.ChoiceField(choices=STYLE_CHOICES, default='friendly')%0A%0A    def create(self, validated_data):%0A        %22%22%22%0A        Create and return a new %60Snippet%60 instance, given the validated data.%0A        %22%22%22%0A        return Snippet.objects.create(**validated_data)%0A%0A    def update(self, instance, validated_data):%0A        %22%22%22%0A        Update and return an existing %60Snippet%60 instance, given the validated data.%0A        %22%22%22%0A        instance.title = validated_data.get('title', instance.title)%0A        instance.code = validated_data.get('code', instance.code)%0A        instance.linenos = validated_data.get('linenos', instance.linenos)%0A        instance.language = validated_data.get('language', instance.language)%0A        instance.style = validated_data.get('style', instance.style)%0A        instance.save()%0A        return instance%0A

create serializers.py module to serialize snippets of information