41 lines
880 B
Python
41 lines
880 B
Python
from rest_framework import serializers
|
|
|
|
from vbv_lernwelt.course.models import (
|
|
Course,
|
|
CourseCategory,
|
|
CourseCompletion,
|
|
)
|
|
|
|
|
|
class CourseSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Course
|
|
fields = ["id", "title", "category_name"]
|
|
|
|
|
|
class CourseCategorySerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = CourseCategory
|
|
fields = [
|
|
"id",
|
|
"title",
|
|
"general",
|
|
]
|
|
|
|
|
|
class CourseCompletionSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = CourseCompletion
|
|
fields = [
|
|
"id",
|
|
"created_at",
|
|
"updated_at",
|
|
"user",
|
|
"page_key",
|
|
"page_type",
|
|
"page_slug",
|
|
"course",
|
|
"completion_status",
|
|
"additional_json_data",
|
|
]
|