开发者

Django admin remove m2m inlines?

开发者 https://www.devze.com 2023-03-06 12:51 出处:网络
I am using the Django admin with the Grappelli app to manage an M2M relationship (Gallery - Image) with an intermediary model with inline form sections.

I am using the Django admin with the Grappelli app to manage an M2M relationship (Gallery - Image) with an intermediary model with inline form sections.

I've added a gallery record w开发者_Go百科ith multiple images successfully, however when I go back and edit the record, I cannot remove any of the inline images.

The only way I have managed to remove the relationship is by deleting the image record separately.

Simply emptying the fields and saving throws up validation errors (ie This field is required etc). All I want to do is remove one or more inline form sections in its entirety.

Can anyone help?

Any advice appreciated.


There should be a checkbox for each inline to delete it.

If you can't see the delete checkboxes, then perhaps your user does not have the permission to delete the intermediary model.

0

精彩评论

暂无评论...
验证码 换一张
取 消