Internal
Public Access
Features: - Django-based REST API with web interface - Task management with tags, priorities, and due dates - Time tracking with start/stop timers - Subtasks support - Task filtering (all, today, upcoming, overdue, completed) - Tag-based organization with color coding - Sorting by due date and priority - Auto-assign tags when filtering - Responsive 3-pane layout (sidebar, task list, detail panel) - Task sharing between users - Mobile-responsive design with dark mode support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
30 lines
889 B
Python
30 lines
889 B
Python
"""
|
|
Notification serializers for KeepItGoing API.
|
|
"""
|
|
|
|
from rest_framework import serializers
|
|
from .models import Notification, ScheduledReminder
|
|
|
|
|
|
class NotificationSerializer(serializers.ModelSerializer):
|
|
"""Serializer for notifications."""
|
|
|
|
task_title = serializers.CharField(source='task.title', read_only=True)
|
|
|
|
class Meta:
|
|
model = Notification
|
|
fields = [
|
|
'id', 'notification_type', 'title', 'message', 'task',
|
|
'task_title', 'is_read', 'read_at', 'created_at'
|
|
]
|
|
read_only_fields = ['id', 'created_at']
|
|
|
|
|
|
class ScheduledReminderSerializer(serializers.ModelSerializer):
|
|
"""Serializer for scheduled reminders."""
|
|
|
|
class Meta:
|
|
model = ScheduledReminder
|
|
fields = ['id', 'task', 'remind_at', 'is_sent', 'sent_at', 'created_at']
|
|
read_only_fields = ['id', 'is_sent', 'sent_at', 'created_at']
|