forked from erp-dev/erp
27 lines
818 B
Python
27 lines
818 B
Python
import logging
|
|
from django.apps import AppConfig
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class PrintingConfig(AppConfig):
|
|
default_auto_field = 'django.db.models.BigAutoField'
|
|
name = 'printing'
|
|
verbose_name = '印染管理'
|
|
|
|
def ready(self):
|
|
"""注册信号处理函数"""
|
|
from stateflow.signals import process_completed
|
|
from .models import PrintingJob
|
|
from . import handlers
|
|
|
|
# 监听 PrintingJob 流程完成信号
|
|
process_completed.connect(
|
|
handlers.on_printing_job_process_completed,
|
|
sender=PrintingJob
|
|
)
|
|
|
|
logger.info(
|
|
f'[printing.apps] 已注册 process_completed 信号处理器, '
|
|
f'sender={PrintingJob}, handler={handlers.on_printing_job_process_completed}'
|
|
) |