18 lines
589 B
Python
18 lines
589 B
Python
from rest_framework import serializers
|
|
|
|
from portfolio.models import Project, ProjectEntry
|
|
|
|
|
|
class ProjectSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Project
|
|
fields = ('id', 'title', 'description', 'objectives', 'slug', 'appearance', 'student', 'final',)
|
|
read_only_fields = ('id', 'slug',)
|
|
|
|
|
|
class ProjectEntrySerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = ProjectEntry
|
|
fields = ('id', 'activity', 'reflection', 'next_steps', 'document_url', 'created', 'project')
|
|
read_only_fields = ('id', 'created',)
|