{ "info": { "author": "Kelvin Wong", "author_email": "code@kelvinwong.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP" ], "description": "****************************\ndjango-select-multiple-field\n****************************\n\nSelect multiple choices in a single Django model field. Use whenever you want\nto store multiple choices in a field without using a many-to-many relation.\n\n.. figure:: https://github.com/kelvinwong-ca/django-select-multiple-field/raw/master/docs/images/select_multiple_cropped.jpg\n\n Rendered using the multiselect.js plugin for jQuery [#]_\n\n.. [#] jquery.multi-select.js https://github.com/lou/multi-select\n\nQuick Start\n===========\n\n.. important::\n\n Field attribute ``max_length`` must be set to a value longer than your\n longest expected encoded string\n\n.. important::\n\n Choices must be strings, not integers.\n\nIn your models add the select field choices normally::\n\n # models.py\n\n class Pizza(models.Model):\n ANCHOVIES = 'a'\n BLACK_OLIVES = 'b'\n PEPPERONI = 'p'\n MOZZARELLA = 'm'\n TOPPING_CHOICES = (\n (ANCHOVIES, 'Anchovies'),\n (BLACK_OLIVES, 'Black olives'),\n (PEPPERONI, 'Pepperoni'),\n (MOZZARELLA, 'Mozzarella'),\n )\n\n toppings = SelectMultipleField(\n max_length=10,\n choices=TOPPING_CHOICES\n )\n\nUse a generic view or a modelform as usual. In your template you can use a regular form tag::\n\n # template_form.html\n\n
\n {{ form.as_p }}\n \n
\n\nThis renders the following HTML::\n\n # create.html\n\n
\n

\n \n \n

\n \n
\n\nDisplaying stored choices\n-------------------------\n\nTo display your choices, you will need to decode the field contents. This can\nbe accomplished with a template tag::\n\n # templatetags/pizza_tags.py\n\n def decode_pie(ingredients):\n \"\"\"\n Decode pizza pie toppings\n \"\"\"\n decoder = dict(Pizza.TOPPING_CHOICES)\n decoded = [decoder[t] for t in ingredients]\n decoded.sort()\n return ', '.join(decoded)\n\n register.filter('decode_pie', decode_pie)\n\nIn your template you need to import your tags and use them::\n\n # details.html\n\n {% load pizza_tags %}\n\n {{ pizza.toppings|decode_pie }}\n\nEncoding the choices\n====================\n\nThe choices that are selected are stored as comma-delimited text. Consider a\npizza with the following toppings.\n\n * Pepperoni\n * Mozzarella\n\nThis would be stored as a character field as::\n\n p,m\n\nThis encoded string is decoded to a Python list using functions in the codecs\nmodule::\n\n >>> from select_multiple_field.codecs import *\n >>> encoded = 'a,b,c'\n >>> decoded = decode_csv_to_list(encoded)\n >>> print decoded\n [u'a', u'b', u'c']\n >>> print type(decoded)\n \n\nThe method of encoding may limit your ability to search for choices.\n\nSample application\n==================\n\nThere is a sample application included if you downloaded the tarball. You can try it like this::\n\n $ pwd\n /home/user/teststuff/django-select-multiple-field\n $ cd test_projects/django14\n $ python manage.py syncdb\n $ python manage.py runserver\n\n Validating models...\n\n 0 errors found\n Django version 1.4.19, using settings 'django14.settings'\n Development server is running at http://127.0.0.1:8000/\n Quit the server with CONTROL-C.\n\nTroubleshooting\n===============\n\nDjango-select-multiple-field contains two test suites. One is for the field and one is for an implementation of the field in a Django 1.4.19 project.\n\nYou can run the field tests by downloading the tarball and running 'test' in setup.py::\n\n $ python setup.py test\n\nYou can run the Django 1.4.19 demo test in a similar manner::\n\n $ python setup.py test_demo\n\nNeedless to say you will need to have Django 1.4.19 or later installed.\n\nBugs! Help!!\n============\n\nIf you find any bugs in this software please report them via the Github\nissue tracker [#]_ or send an email to code@kelvinwong.ca. Any serious\nsecurity bugs should be reported via email only.\n\n.. [#] Django-select-multiple-field issue tracker https://github.com/kelvinwong-ca/django-select-multiple-field/issues\n\nLinks\n=====\n\n* https://pypi.python.org/pypi/django-select-multiple-field/\n* https://github.com/kelvinwong-ca/django-select-multiple-field\n\nThank-you\n=========\n\nThank-you for taking the time to evaluate this software. I appreciate\nreceiving feedback on your experiences using it and I welcome code\ncontributions and development ideas.\n\nhttp://www.kelvinwong.ca/coders", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kelvinwong-ca/django-select-multiple-field", "keywords": "select,select multiple,Django,model-field,Django-Select-Multiple-Field", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-select-multiple-field", "package_url": "https://pypi.org/project/django-select-multiple-field/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-select-multiple-field/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kelvinwong-ca/django-select-multiple-field" }, "release_url": "https://pypi.org/project/django-select-multiple-field/0.4.2/", "requires_dist": null, "requires_python": null, "summary": "Select multiple choices in a single Django model field", "version": "0.4.2" }, "last_serial": 1862512, "releases": { "0.0.1": [], "0.0.2": [ { "comment_text": "", "digests": { "md5": "e3ebc8540fb5c76ee927e47445013c8a", "sha256": "2763c171f2b81d08e4e9d88896d63e74391604eeb3fa970616a5bd4dd2432256" }, "downloads": -1, "filename": "django-select-multiple-field-0.0.2.tar.gz", "has_sig": true, "md5_digest": "e3ebc8540fb5c76ee927e47445013c8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5050, "upload_time": "2014-05-23T00:53:39", "url": "https://files.pythonhosted.org/packages/0a/6a/78f1b4c61941912c225de1bcfcdbf4d81a76f9e7c66c219225d40d3a9569/django-select-multiple-field-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "8c790367823316f0dd2515db4f6dc7f1", "sha256": "aa944b702aab1667eb6ac6c8616208e88d8e3903f049231089be64f3bd92037c" }, "downloads": -1, "filename": "django-select-multiple-field-0.0.3.tar.gz", "has_sig": true, "md5_digest": "8c790367823316f0dd2515db4f6dc7f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25844, "upload_time": "2014-05-23T01:18:05", "url": "https://files.pythonhosted.org/packages/a7/6a/fad28fe8a06b49083d4d8b70ee33248aba1c288ee743f325bcacb3d271bb/django-select-multiple-field-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "436c74cc89a2671635df02d925d270f9", "sha256": "8a89c888419e2e12f3119d22f0918a683270fd4f4758ddef203355741c6009f4" }, "downloads": -1, "filename": "django-select-multiple-field-0.0.4.tar.gz", "has_sig": true, "md5_digest": "436c74cc89a2671635df02d925d270f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27126, "upload_time": "2014-05-25T22:53:04", "url": "https://files.pythonhosted.org/packages/ee/b9/99b35479716e95aa48b6f79e177f0e19349ca57156119eaee98cb7849d34/django-select-multiple-field-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "8d54402c34f6ce75d950e0f8526fd32a", "sha256": "aaeafb7120de4aeb57d2c4673655b0d986bdb90825c0e7586b510a3a877819c9" }, "downloads": -1, "filename": "django-select-multiple-field-0.0.5.tar.gz", "has_sig": true, "md5_digest": "8d54402c34f6ce75d950e0f8526fd32a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31967, "upload_time": "2014-06-09T22:31:16", "url": "https://files.pythonhosted.org/packages/7d/e1/c41a5fda4e88f43b30d01bd302109bc350883f37c65bcf39906096c0aa8d/django-select-multiple-field-0.0.5.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "e515e6aa0290f46d81928e688bf16a38", "sha256": "1597487af34c11c7a76b37579128987e323eafdec43abadefa36f32adcd29c97" }, "downloads": -1, "filename": "django-select-multiple-field-0.1.0.tar.gz", "has_sig": true, "md5_digest": "e515e6aa0290f46d81928e688bf16a38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31952, "upload_time": "2014-06-11T22:07:36", "url": "https://files.pythonhosted.org/packages/53/df/5c9bd22488f46e7ef13821a23c7bf3360a3595067a7372eb0737bb0dbf80/django-select-multiple-field-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a3a02e8834fc526ce93e8d13f621e688", "sha256": "f19b2c7f3049f9111abc4d4ab0cc9372d55b6ec2d05fefaf6f700bd0e6cec69c" }, "downloads": -1, "filename": "django-select-multiple-field-0.2.0.tar.gz", "has_sig": true, "md5_digest": "a3a02e8834fc526ce93e8d13f621e688", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34128, "upload_time": "2014-06-16T05:41:50", "url": "https://files.pythonhosted.org/packages/cf/87/16c13e3d836291370f707071fd25dccab00c8dfb775411d38756c76552bb/django-select-multiple-field-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "24779fe31b3301d909fc35946101004e", "sha256": "57200329167f6cb0da929fa6d40ef1578441718e40eac28c6a4d2a52e6a162c8" }, "downloads": -1, "filename": "django-select-multiple-field-0.3.0.tar.gz", "has_sig": true, "md5_digest": "24779fe31b3301d909fc35946101004e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37947, "upload_time": "2014-06-18T07:40:43", "url": "https://files.pythonhosted.org/packages/65/55/e237f2775f981ef41b5fc46d18dc09a893395f67cd2731fd3ace5a3065ee/django-select-multiple-field-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "6059a979cdd014ebc5ddd65507ce2d74", "sha256": "751fdf0545b6e80f31737730b1bf2166d507cff46347f7c3414d068380d047f2" }, "downloads": -1, "filename": "django-select-multiple-field-0.3.1.tar.gz", "has_sig": true, "md5_digest": "6059a979cdd014ebc5ddd65507ce2d74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38814, "upload_time": "2015-02-08T05:20:58", "url": "https://files.pythonhosted.org/packages/18/41/51a077418d7ba1db9e79c26815e4fa74c9bdb4fa751a46261b343a20b405/django-select-multiple-field-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "faad2467dc040e67149ba227385dd626", "sha256": "388f3e99dbfe200536b5a74363a7e6ac3e6aae760faaa78b49cb74eaf482bf5c" }, "downloads": -1, "filename": "django-select-multiple-field-0.4.0.tar.gz", "has_sig": true, "md5_digest": "faad2467dc040e67149ba227385dd626", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43670, "upload_time": "2015-02-14T22:08:07", "url": "https://files.pythonhosted.org/packages/9e/eb/f3d980774e0c9bcb2cac7e6351fbb88971dae1dedf1f05132f0c87fe8bf8/django-select-multiple-field-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "19fdb121eface7a2c950aea63ece3d31", "sha256": "1d2b66005737616298a69030431e6a92a30fba7f86951bfb919bf881f1c24ffe" }, "downloads": -1, "filename": "django-select-multiple-field-0.4.1.tar.gz", "has_sig": true, "md5_digest": "19fdb121eface7a2c950aea63ece3d31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44687, "upload_time": "2015-10-18T03:48:45", "url": "https://files.pythonhosted.org/packages/c9/1c/7c8b2a8f21b049c504ce5ecb5969a2f7c5690a5b756c254facdb148e9876/django-select-multiple-field-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "4c2a98876effda47c193fc0a27517555", "sha256": "18cc3221204b1516718d528fc14d39548af3a130a2355cc668251f78b18d75e8" }, "downloads": -1, "filename": "django-select-multiple-field-0.4.2.tar.gz", "has_sig": true, "md5_digest": "4c2a98876effda47c193fc0a27517555", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 49556, "upload_time": "2015-12-14T23:56:24", "url": "https://files.pythonhosted.org/packages/f1/8f/55fa7ec46befed4666fb27f912c14c027d06cf16eab80d52b7be836bde4e/django-select-multiple-field-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4c2a98876effda47c193fc0a27517555", "sha256": "18cc3221204b1516718d528fc14d39548af3a130a2355cc668251f78b18d75e8" }, "downloads": -1, "filename": "django-select-multiple-field-0.4.2.tar.gz", "has_sig": true, "md5_digest": "4c2a98876effda47c193fc0a27517555", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 49556, "upload_time": "2015-12-14T23:56:24", "url": "https://files.pythonhosted.org/packages/f1/8f/55fa7ec46befed4666fb27f912c14c027d06cf16eab80d52b7be836bde4e/django-select-multiple-field-0.4.2.tar.gz" } ] }