mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2024-11-17 04:09:25 +08:00
11 lines
376 B
Python
11 lines
376 B
Python
from notifications.models import Notification
|
|
from rest_framework import serializers
|
|
|
|
|
|
class NotificationSerializer(serializers.ModelSerializer):
|
|
timestamp = serializers.DateTimeField(format="%m-%d-%Y %I:%M %p", read_only=True)
|
|
|
|
class Meta:
|
|
model = Notification
|
|
fields = "__all__"
|
|
read_only_fields = ("id", "recipient", "content", "timestamp")
|