1

I can't seem to get the sortable inlines feature (in grappelli) work for me.

I'm starting to wonder if the feature is not supported for ManyToManyFields or if I am not getting it right.

Also, is there a sample code out there so I can see and learn? I already followed the method described here.

4

1 回答 1

0

M2M 字段对我不起作用。但是,事实证明有一个解决方法。

through为 a 创建了一个模型ManyToManyField并添加order到该through模型中。请记住,through模型使用ForeignKey字段。因此,这个案例本质上变成了管理一对多关系的案例。

实现可排序的内联现在就像遵循 Grappelli 的文档一样简单。

于 2013-07-21T05:40:49.483 回答