多个从左到右的选择字段 [英] Multiple left to right selection field

查看:98
本文介绍了多个从左到右的选择字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一下是否有任何字段(如下面所附的字段)在Django中作为单个对象可用.如果否,那么我们如何生成将所选项目移到右侧的功能.

I would like to ask whether there is any field, like the one attached below, available in Django as a single object. If no, then how can we generate such a functionality of moving selected items to the right hand side.

请指导,我将非常感谢.

Please guide, I shall be extremly thankful.

推荐答案

您可以使用Django的

You could make use of Django's FilteredSelectMultiple widget, as seen in the django-admin when you use filter_horizontal on a ManyToManyField:

以下是使用您自己的表单自己进行操作的示例: http://djangosnippets.org/snippets/2466/

Here's an example of doing it yourself with your own form: http://djangosnippets.org/snippets/2466/

这篇关于多个从左到右的选择字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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