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.
jumpserver/apps/perms/serializers.py

33 lines
738 B

8 years ago
# -*- coding: utf-8 -*-
#
from rest_framework import serializers
from .models import AssetPermission
8 years ago
7 years ago
class AssetPermissionCreateUpdateSerializer(serializers.ModelSerializer):
8 years ago
class Meta:
model = AssetPermission
exclude = ('id', 'create_by', 'date_created')
7 years ago
class AssetPermissionListSerializer(serializers.ModelSerializer):
class Meta:
model = AssetPermission
7 years ago
fields = '__all__'
class AssetPermissionUpdateUserSerializer(serializers.ModelSerializer):
class Meta:
model = AssetPermission
fields = ['id', 'users']
class AssetPermissionUpdateAssetSerializer(serializers.ModelSerializer):
class Meta:
model = AssetPermission
fields = ['id', 'assets']