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.
41 lines
1.3 KiB
41 lines
1.3 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') |
|
|
|
|
|
class CinemaUserSerializer(serializers.ModelSerializer): |
|
class Meta: |
|
model = CinemaUser |
|
fields = ('id', 'username', 'is_delete', 'pinyin') |
|
|
|
|
|
class ReleaseSerializer(serializers.ModelSerializer): |
|
class Meta: |
|
model = Release |
|
fields = ('id', 'version', 'short_ver', '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', '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', 'process', 'is_sys', 'is_checked', 'is_delete', 'update_time')
|
|
|