我正在创建一个模型实例(Container),似乎没有触发pre_save函数。
这是“信号”中的类:
class ContainerCreatedMixin(object):
@staticmethod
@receiver(pre_save, sender=Container)
def container_pre_save(sender, instance, **kwargs):
# create container folder if not created yet
if instance.folder_created_at is None:
is_folder_created = ContainerCreatedMixin().create_folder(instance)
if is_folder_created:
instance.folder_created_at = now()
def create_virtual_folder(self, container):
try:
......