- Rename calendar_app → scheduling (integration app for django-scheduler) - Move schedule_patch.py → scheduling/patch.py with improved logging - Create scheduling.notifications system for django-scheduler events - Add scheduling.rules for django-rules integration - Remove unused calendar_app models and API (not registered in urls) - Remove backend/api/v1/calendar/ (dead code) - Remove old tests for calendar_app - Add comprehensive documentation in scheduling/README.md - Update settings.py: calendar_app.apps.CalendarAppConfig → scheduling.apps.SchedulingConfig - Clean api/apps.py: remove schedule_patch import (now in scheduling.apps) The scheduling app provides: - Patches for django-scheduler bugs (byweekday fix) - Notification system for calendar events - Access rules via django-rules - Auto-applies on Django startup Closes integration of django-scheduler for EUSRR calendar system.
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
"""
|
||
Конфигурация приложения scheduling.
|
||
Применяет патчи к django-scheduler и регистрирует сигналы.
|
||
"""
|
||
from django.apps import AppConfig
|
||
|
||
|
||
class SchedulingConfig(AppConfig):
|
||
"""Конфигурация приложения для интеграции с django-scheduler."""
|
||
|
||
default_auto_field = 'django.db.models.BigAutoField'
|
||
name = 'scheduling'
|
||
verbose_name = 'Планирование и календарь'
|
||
|
||
def ready(self):
|
||
"""
|
||
Инициализация приложения:
|
||
1. Применяет патчи к django-scheduler
|
||
2. Регистрирует сигналы для уведомлений
|
||
3. Загружает правила доступа (django-rules)
|
||
"""
|
||
# Применяем патчи к django-scheduler
|
||
from scheduling import patch
|
||
patch.apply_patch()
|
||
|
||
# Регистрируем сигналы для уведомлений
|
||
import scheduling.notifications.signals # noqa: F401
|
||
|
||
# Загружаем правила доступа (django-rules)
|
||
try:
|
||
import scheduling.rules # noqa: F401
|
||
except ImportError:
|
||
# rules.py опционален
|
||
pass
|