This repository has been archived on 2022-09-23. You can view files and clone it, but cannot push or open issues or pull requests.
webdev/website/posts/serializers.py

10 lines
271 B
Python

from django.contrib.auth.models import User
from .models import *
from rest_framework import serializers
class PostSerializer(serializers.ModelSerializer):
class Meta:
model = Post
# better to explicitly mention the fields
fields = '__all__'