使用拖放和拖放重新排序项的模型 [英] Re-ordering entries in a model using drag-and-drop

查看:131
本文介绍了使用拖放和拖放重新排序项的模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我在Django里有一个博客应用程序。如何使用默认管理员中的可拖动表重新排序帖子?



最好不要在模型中添加任何额外的字段,但是如果我真的需要我可以。

解决方案

对于工作代码执行此操作,请查看片段1053 djangosnippets。 org


Say I have a blogging app in Django. How can i re-order the posts using a draggable table in the default admin?

It would be best if i didn't have to add any extra fields to the model, but if i really have to i can.

解决方案

For working code to do this, check out snippet 1053 at djangosnippets.org.

这篇关于使用拖放和拖放重新排序项的模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆