Nullable ForeignKeys and deleting a referenced model instance

前端 未结 2 500
刺人心
刺人心 2021-02-09 07:45

I have a ForeignKey which can be null in my model to model a loose coupling between the models. It looks somewhat like that:

class Message(models.Model):
  sende         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-09 08:14

    Having just discovered the ON DELETE CASCADE behaviour myself, I see that in Django 1.3 they have made the foreign key behaviour configurable.

提交回复
热议问题