Created
April 6, 2017 06:21
-
-
Save hassanabidpk/f37c97e814af4b0ea9c11f4fef616a4f to your computer and use it in GitHub Desktop.
Serializer for Medium blog post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework import serializers | |
from .models import Restaurant | |
class RestaurantSerializer(serializers.ModelSerializer): | |
class Meta: | |
model = Restaurant | |
fields = ('id', 'name', 'description', 'image') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment