sync from local backup
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from rest_framework import serializers
|
||||
from .models import Changelog
|
||||
|
||||
|
||||
class ChangelogSerializer(serializers.ModelSerializer):
|
||||
"""更新日志序列化器"""
|
||||
|
||||
update_type_display = serializers.CharField(
|
||||
source='get_update_type_display',
|
||||
read_only=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Changelog
|
||||
fields = [
|
||||
'id', 'version', 'title', 'description',
|
||||
'update_type', 'update_type_display',
|
||||
'published_at', 'is_published',
|
||||
'created_at', 'updated_at',
|
||||
]
|
||||
read_only_fields = ['created_at', 'updated_at']
|
||||
Reference in New Issue
Block a user