class DatabaseAppPermissionListSerializer(BulkOrgResourceModelSerializer): users = StringManyToManyField(many=True, read_only=True) user_groups = StringManyToManyField(many=True, read_only=True) database_apps = StringManyToManyField(many=True, read_only=True) system_users = StringManyToManyField(many=True, read_only=True) is_valid = serializers.BooleanField() is_expired = serializers.BooleanField() class Meta: model = models.DatabaseAppPermission fields = '__all__'
class JenkinsPermissionListSerializer(BulkOrgResourceModelSerializer): users = StringManyToManyField(many=True, read_only=True) user_groups = StringManyToManyField(many=True, read_only=True) jenkins = StringManyToManyField(many=True, read_only=True, source='cis') nodes = StringManyToManyField(many=True, read_only=True) is_valid = serializers.BooleanField() is_expired = serializers.BooleanField() class Meta: model = CiPermission fields = '__all__'
class AssetPermissionListSerializer(serializers.ModelSerializer): users = StringManyToManyField(many=True, read_only=True) user_groups = StringManyToManyField(many=True, read_only=True) assets = StringManyToManyField(many=True, read_only=True) nodes = StringManyToManyField(many=True, read_only=True) system_users = StringManyToManyField(many=True, read_only=True) is_valid = serializers.BooleanField() is_expired = serializers.BooleanField() class Meta: model = AssetPermission fields = '__all__'
class ClassifyListSerializer(serializers.ModelSerializer): assets = StringManyToManyField(many=True, read_only=True) nodes = StringManyToManyField(many=True, read_only=True) # inherit = serializers.SerializerMethodField() class Meta: model = Classify # fields = '__all__' fields = [ 'id', 'name', 'model', 'height', 'material_name', 'weight', 'rated_power', 'device_type', 'snmp_version', 'material', 'front_pic_file', 'rear_pic_file', 'assets', 'nodes', 'is_active', 'created_by', 'date_created', 'comment' ]
class AssetPermissionListSerializer(serializers.ModelSerializer): users = StringManyToManyField(many=True, read_only=True) user_groups = StringManyToManyField(many=True, read_only=True) assets = StringManyToManyField(many=True, read_only=True) nodes = StringManyToManyField(many=True, read_only=True) system_users = StringManyToManyField(many=True, read_only=True) inherit = serializers.SerializerMethodField() class Meta: model = AssetPermission fields = '__all__' @staticmethod def get_inherit(obj): if hasattr(obj, 'inherit'): return obj.inherit else: return None
class GalleryListSerializer(serializers.ModelSerializer): effects = StringManyToManyField(many=True, read_only=True) # inherit = serializers.SerializerMethodField() class Meta: model = Gallery # fields = '__all__' fields = [ 'id', 'name', 'music', 'effects', 'music_name', 'is_active', 'created_by', 'date_created', 'comment' ]
class VideoCombineListSerializer(serializers.ModelSerializer): videos = StringManyToManyField(many=True, read_only=True) # inherit = serializers.SerializerMethodField() class Meta: model = VideoCombine # fields = '__all__' fields = [ 'id', 'name', 'music', 'gallery', 'effect', 'video_quantity', 'videos', 'music_name', 'gallery_name', 'effect_name', 'is_active', 'created_by', 'date_created', 'comment' ]
class MusicListSerializer(serializers.ModelSerializer): gallerys = StringManyToManyField(many=True, read_only=True) inherit = serializers.SerializerMethodField() class Meta: model = Music fields = '__all__' @staticmethod def get_inherit(obj): if hasattr(obj, 'inherit'): return obj.inherit else: return None
class JenkinsPermissionListCisSerializer(serializers.ModelSerializer): cis = StringManyToManyField(many=True, read_only=True) class Meta: model = CiPermission fields = ['cis']
class UserGroupListSerializer(UserGroupSerializer): users = StringManyToManyField(many=True, read_only=True)