33 lines
736 B
Python
33 lines
736 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
@Remark: app版本管理
|
|
"""
|
|
from utils.serializers import CustomModelSerializer
|
|
from utils.viewset import CustomModelViewSet
|
|
from mysystem.models import AppVersion
|
|
|
|
|
|
class AppVersionSerializer(CustomModelSerializer):
|
|
"""
|
|
app版本管理 简单序列化器
|
|
"""
|
|
|
|
class Meta:
|
|
model = AppVersion
|
|
fields = "__all__"
|
|
read_only_fields = ["id"]
|
|
|
|
class AppVersionViewSet(CustomModelViewSet):
|
|
"""
|
|
app版本管理 后台接口
|
|
list:查询
|
|
create:新增
|
|
update:修改
|
|
retrieve:单例
|
|
destroy:删除
|
|
"""
|
|
queryset = AppVersion.objects.all()
|
|
serializer_class = AppVersionSerializer
|
|
filter_fields = ('type',)
|
|
search_fields = ('name',) |