|
|
|
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')
|
|
|
|
|
|
|
|
|
|
|
|
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_delete', 'update_time')
|