Update django.md

main
Matt Huntington 5 years ago committed by GitHub
parent a4bb5e9baf
commit 0a73a92b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -194,7 +194,7 @@ Create contacts_api/serializers.py and add
from rest_framework import serializers from rest_framework import serializers
from .models import Contact from .models import Contact
class ContactSerializer(serializers.HyperlinkedModelSerializer): # serializers.HyperlinkedModelSerializer just tells django to convert sql to JSON class ContactSerializer(serializers.ModelSerializer): # serializers.ModelSerializer just tells django to convert sql to JSON
class Meta: class Meta:
model = Contact # tell django which model to use model = Contact # tell django which model to use
fields = ('id', 'name', 'age',) # tell django which fields to include fields = ('id', 'name', 'age',) # tell django which fields to include

Loading…
Cancel
Save