문제

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.

도움이 되었습니까?

해결책

M2M Fields didn't work for me. But, turns out there's a work-around for this.

I created a through model for a ManyToManyField and added order in that through model. Remember, the through model uses ForeignKey fields. So, the case essentially becomes that of managing a couple of one-to-many relationships.

Implementing sortable inlines is now as easy as following Grappelli's documentation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top