将我的signals.py文件保留在Django项目中的正确位置
根据我正在阅读的Django文档,似乎signals.py在app文件夹中是一个不错的起点,但是我面临的问题是,当我为创建信号pre_save并尝试从模型中导入类时,它与import在我的模型中。 # models.py from django.contrib.auth.models import User from django.db import models from django.utils.translation import gettext as _ from signals import * class Comm_Queue(CommunicatorAbstract): queue_statuses = ( ('P', _('Pending')), ('S', _('Sent')), ('E', _('Error')), ('R', _('Rejected')), ) status = models.CharField(max_length=10, db_index=True, default='P') is_html = models.BooleanField(default=False) language = models.CharField(max_length=6, choices=settings.LANGUAGES) sender_email = models.EmailField() …