【发布时间】:2017-11-17 22:56:07
【问题描述】:
我有两个模型。 当我尝试删除联系人时收到错误
Exception Value:
("Cannot delete some instances of model 'GuestContact' because they are referenced through a protected foreign key: 'Reservation.res_company'", <QuerySet [<Reservation: Reservation object>, <Reservation: Reservation object>]>)
我不想看到 django 错误页面。我要发送信息“此记录无法删除,但此联系人用于预订”
你能帮我吗?
问候
【问题讨论】:
-
您可以发布视图吗??
标签: django django-models django-forms django-templates django-views