notifications/apps/push_notifications/serializers.py
Ali Asadi 2dbe021fe5 REFACTOR(notifications): rename code/click_object_id to action_code/click_object_id_value
`code` was ambiguous next to Python's own use of "code"; `action_code` names
its actual role (a click-action lookup key). click_object_id_value pairs it
consistently with action_code. Renamed on both PushMessage and
NotificationLink via a data-preserving RenameField migration, threaded
through the serializer, admin, bulk-push path, and docs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-23 12:13:29 +03:30

29 lines
707 B
Python

from rest_framework import serializers
from .models import PushUser, PushMessage
class PushUserSerializer(serializers.ModelSerializer):
class Meta:
model = PushUser
fields = (
"user",
"client_token",
"application_token"
)
class PushMessageSerializer(serializers.ModelSerializer):
class Meta:
model = PushMessage
fields = (
"push_user",
"application",
"title",
"message",
"priority",
"extras",
"click_url",
"action_code",
"click_object_id_value",
)
read_only_fields = ("push_user","application")