10 lines
271 B
Python
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__'
|