dingxin_toolbox
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

from rest_framework import serializers, fields
from update.models import *
class CinemaSerializer(serializers.ModelSerializer):
update_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
class Meta:
model = Cinema
fields = (
'id', 'name', 'ip', 'zz_num', 'inner_id', 'db_user', 'db_pwd', 'sys_ver', 'client_ver', 'user',
'update_time', 'is_cloud', 'remote_label', 'ver_id')
class CinemaUserSerializer(serializers.ModelSerializer):
class Meta:
model = CinemaUser
fields = ('id', 'username', 'is_delete', 'pinyin')
class ReleaseSerializer(serializers.ModelSerializer):
class Meta:
model = Release
fields = ('id', 'release', 'short_release', 'main_ver', 'ver_id', 'status')
class ClientReleaseSerializer(serializers.ModelSerializer):
update_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
class Meta:
model = ClientRelease
fields = (
'id', 'origin_name', 'client_ver', 'main_ver', 'sub_ver', 'ver_id', 'upload_name', 'client_type',
'is_delete', 'update_time')
class UpdateCommandSerializer(serializers.ModelSerializer):
update_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
class Meta:
model = UpdateCommand
fields = (
'id', 'desc', 'command', 'ver_id', 'process', 'run_num', 'is_sys', 'is_checked', 'is_force', 'is_delete',
'comment', 'update_time')
class UpdateAlterSerializer(serializers.ModelSerializer):
update_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
class Meta:
model = UpdateAlter
fields = ('id', 'ver_id', 'alter', 'update_time')
class UpdateLogSerializer(serializers.ModelSerializer):
time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
class Meta:
model = UpdateLog
fields = ('id', 'ip', 'type', 'origin_ver', 'target_ver', 'time', 'result', 'result_detail')