2026-09-07 19:43:48 +03:00

39 lines
1.4 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
Конфигурация приложения 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
import scheduling.realtime_signals # noqa: F401
import scheduling.signals # noqa: F401
# Загружаем правила доступа (django-rules)
try:
import scheduling.rules # noqa: F401
except ImportError:
# rules.py опционален
pass