jumpserver/apps/assets/serializers/mixin.py

12 lines
382 B
Python
Raw Normal View History

2022-04-30 15:19:43 +00:00
from rest_framework import serializers
from django.utils.translation import gettext_lazy as _
class CategoryDisplayMixin(serializers.Serializer):
category_display = serializers.ReadOnlyField(
source='get_category_display', label=_("Category display")
)
type_display = serializers.ReadOnlyField(
source='get_type_display', label=_("Type display")
)