DRF_Template/backend/user_groups/serializers.py

13 lines
372 B
Python
Raw Normal View History

from rest_framework import serializers
2024-10-31 00:33:13 +08:00
from .models import UserGroup
class SimpleUserGroupSerializer(serializers.ModelSerializer):
date_created = serializers.DateTimeField(format="%m-%d-%Y %I:%M %p", read_only=True)
class Meta:
model = UserGroup
fields = ["id", "name", "date_created"]
read_only_fields = ["id", "name", "date_created"]