为django选择2个选项字段
mysociety-Django-Select2的Python项目详细描述
django-选择2
[![PYPI版本](https://img.shields.io/pypi/v/Django-Select2.svg)](https://pypi.python.org/pypi/Django-Select2/) [![生成状态](https://travis-ci.org/applegrew/django-select2.svg?branch=master)](https://travis-ci.org/applegrew/django-select2) [![代码运行状况](https://landscape.io/github/applegrew/django-select2/master/landscape.svg?style=flat)](https://landscape.io/github/applegrew/django-select2/master) [![测试覆盖率](https://coveralls.io/repos/applegrew/django-select2/badge.png?branch=master)](https://coveralls.io/r/applegrew/django-select2) [![github许可证](https://img.shields.io/badge/license-APL2-blue.svg)](https://raw.githubusercontent.com/applegrew/django-select2/master/LICENSE.txt) [![加入聊天室https://gitter.im/applegrew/django-select2](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/applegrew/django-select2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
这是[select2](http://ivaynberg.github.com/select2/)的[django](https://www.djangoproject.com/)集成。
该应用程序包括select2驱动的django小部件和表单字段。
安装
安装django_select2
pip install django_select2
在项目设置中将django_select2添加到已安装的应用程序中。
在生产服务器上部署时,请运行:-
python manage.py collectstatic
如果使用任何“auto”字段,请将django_select添加到urlconf。
url(r’^select2/’, include(‘django_select2.urls’)),
更多详细信息
更多细节可以在我的博客-http://blog.applegrew.com/2012/08/django-select2/上找到。
外部依赖性
- Django-这很明显。
- jquery—包中不包括此项,因为在大多数情况下,预计此项已经可用。
- memcached(python memcached)-如果计划运行多个启用了generate_random_select2_id的python进程,则需要启用enable_select2_multi_process_support。在这种模式下,强烈建议您使用memcached,以最小化数据库命中率。
示例应用程序
请参阅应用程序。此应用程序用于手动测试此包的功能。这也是一个很好的例子。
你只需要django 1.4或更高版本就可以运行它。它可能在旧版本上运行,但未经测试。
特别感谢
- samuel goldszmidt(@ouhouhsami)报告了该代码的许多基本问题,因此发布了2.0和2.0.1版本。
官方贡献者
- 约翰内斯·霍普(@codingjoe)
变更日志
参见[changelog.md](changelog.md)
许可证
2012 Nirupam Biswas版权所有
根据apache许可证2.0版(以下简称“许可证”)授权; 除非符合许可证,否则您不能使用此项目。 您可以在
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
除非适用法律要求或书面同意,否则软件 根据许可证分发是按“原样”分发的, 无任何明示或默示的保证或条件。 有关管理权限的特定语言和 许可下的限制。