{ "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.6", "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-likert-field\n*******************\n\nA Likert field for Django models. Useful for adding star-ratings\nfunctionality.\n\n.. figure:: https://github.com/kelvinwong-ca/django-likert-field/raw/master/docs/images/add_form_rendered.jpg\n\n Rendered using the Bootstrap-star-rating plugin for jQuery [#]_\n\n.. [#] Bootstrap-star-rating https://github.com/kartik-v/bootstrap-star-rating\n\nWhy use this?\n=============\n\nDjango-likert-field has the following benefits:\n\n* Just a simple field type for your models (not much else)\n* Doesn't make you add a new table full of stuff when you only need a field\n* Includes useful and simple star rendering filters for Font Awesome and Bootstrap/Glyphicons halflings\n* Includes a simple Django widget that generates HTML that is usable by jQuery star-ratings widgets\n\nInstallation\n============\n\nThis package requires Django 1.4.19 or later. It can be installed in the usual manner with Pip::\n\n pip install django-likert-field\n\nThen add the app to your list of installed apps::\n\n # settings.py\n #\n INSTALLED_APPS = (\n 'likert_field',\n\n ...other apps...\n )\n\nThat's it. No 'syncdb' required. You can now attach the field to your models.\n\nBasic usage\n===========\n\nUse in the same manner as a regular model field::\n\n # models.py\n #\n from likert_field.models import LikertField\n class PetShopSurvey(models.Model):\n i_like_snakes = LikertField()\n\nIn your add.html template::\n\n # add.html\n #\n
\n\nRenders HTML similar to this::\n\n # Renders a widget\n #\n # jQuery star-rating widget should be able to grab by 'likert-field' class\n #\n \n \n\nWhen retrieving your responses, use one of the provided Django filters::\n\n # detail.html\n #\n # assume 'survey' is the context object holding survey instance\n #\n {% load likert_fa_stars %}\n {{ survey.i_like_snakes|fa_stars4 }}\n\nThis will render stars for the framework you choose (Font Awesome 4 in this case)::\n\n # Renders stars\n #\n # assuming one-star Likert item score\n #\n ... other stars maybe...\n\nLikertField in your Django models\n=================================\n\nBy default, your LikertField has the following settings:\n\n* User responses are optional (blank=True)\n* Score is an integer from 0 to n\n* Min value is zero (min_value=0)\n* There is no max value (max_value=None)\n* \"No answer\" is stored in the database as NULL\n\nLikertField stores the score of your Likert item as a simple integer from zero to n. You can set a max_value if you like but one is not set by default. It is assumed that your item is a 5-point Likert item.\n\nPlace the field onto your model::\n\n # models.py\n #\n from django.db import models\n from likert_field.models import LikertField\n\n class PetShopSurvey(models.Model):\n i_like_snakes = LikertField()\n\nIf you require a response, you can set 'blank' to False::\n\n # models.py\n #\n from django.db import models\n from likert_field.models import LikertField\n\n class PetShopSurvey(models.Model):\n i_like_snakes = LikertField(blank=False)\n\n.. warning::\n\n By default, users are not required to provide item responses so the field parameter 'blank' is True. If you want to make your item a required field, set 'blank' to False in your field definition.\n\nIf you require a score from one to seven from your user (a 7-point Likert item). You can set a combination of min and max values with blank set to False to force a response::\n\n # models.py\n #\n from django.db import models\n from likert_field.models import LikertField\n\n class PetShopSurvey(models.Model):\n i_like_snakes = LikertField(\n min_value=1,\n max_value=7,\n blank=False)\n\n.. warning::\n\n If you need a 7-point Likert item (the default is assumed to be 5-point) you must configure the model field *and* the template tag. The value stored in the database is a plain integer with no knowledge of the item settings.\n\nForms\n=====\n\n.. warning::\n\n The form field is now named LikertFormField to avoid collisions with the model field\n\nThis package includes a form field called LikertFormField. It can be used to create a Django form::\n\n # forms.py\n #\n from django.forms import Form\n from likert_field.forms import LikertFormField\n\n class SurveyForm(Form):\n i_like_snakes = LikertFormField()\n\nThis will render a form with the following HTML::\n\n\n \n \n
\n\nWidget\n======\n\nThere is also a simple widget named LikertTextField. It is essentially a TextInput widget that adds a class (\"likert-field\") to the generated HTML input::\n\n >>> from likert_field.widgets import LikertTextField\n >>> w = LikertTextField()\n\n >>> w.render('item_1', 3)\n u''\n\n >>> w.render('item_1', None)\n u''\n\nRendering Your Likert Fields\n============================\n\nOnce the data is in the model, you can render the data by passing the model instance to the Django template via the template context in the regular manner. Once in the template, you can use one of the templatetags to render the integer data as a row of stars.::\n\n # in Django template detail.html\n #\n {% load likert_fa_stars %}\n {{ survey.i_like_snakes|fa_stars4 }}\n\n # It will render the following HTML\n ...etc...\n\nThe general scheme is to filter the model field through the appropriate templatetag.\n\nBootstrap stars\n---------------\n\n.. figure:: https://github.com/kelvinwong-ca/django-likert-field/raw/master/docs/images/bs_stars_color_style.png\n\n The stars on Mac Chrome.\n\nBootstrap uses Glyphicon halflings for font icons. There is a templatetags set for Bootstrap::\n\n # in Django template detail.html\n #\n {% load likert_bs_stars %}\n {{ survey.i_like_snakes|bs_stars3 }}\n\n # It will render the following HTML\n ...etc...\n\nThe two star types for Bootstrap 3 are::\n\n # A lit star\n \n\n # An unlit star\n \n\nYou can add additional style to the star by using the 'likert-star' class::\n\n /* Color the star red comrade */\n .likert-star {\n color: #ff0000;\n }\n\nThe stars will then take on the color you want.\n\n.. figure:: https://github.com/kelvinwong-ca/django-likert-field/raw/master/docs/images/bs_stars_red_style.png\n\n The red stars on Mac Chrome.\n\nFont Awesome stars\n------------------\n\nFont Awesome is a popular font icon set. There is a templatetags set for it::\n\n # in Django template detail.html\n #\n {% load likert_fa_stars %}\n {{ survey.i_like_snakes|fa_stars4 }}\n\n # It will render the following HTML\n ...etc...\n\nThe two star types for Font Awesome 4 are::\n\n # A lit star\n \n\n # An unlit star\n \n\nYou can add additional style to the star by using the 'likert-star' class::\n\n /* Color the star Foundation 5 blue */\n .likert-star {\n color: #008CBA;\n }\n\nThe stars will then take on the color you want.\n\n.. figure:: https://github.com/kelvinwong-ca/django-likert-field/raw/master/docs/images/fa_stars_foundation_5_style.png\n\n The blue stars on Mac Chrome.\n\nYou can attach styles to the lit and unlit stars using standard methods::\n\n /* Gold stars wih outline */\n .fa.fa-star.likert-star {\n color: #ffd76e;\n text-shadow:-1px -1px 0 #e1ba53,\n 1px -1px 0 #e1ba53,\n -1px 1px 0 #e1ba53,\n 1px 1px 0 #e1ba53;\n -webkit-text-stroke: 1px #e1ba53;\n }\n .fa.fa-star-o.likert-star {\n color: #c0c0c0;\n }\n\nThe stars will then take on the styles.\n\n.. figure:: https://github.com/kelvinwong-ca/django-likert-field/raw/master/docs/images/fa_stars_deluxe_style.png\n\n The gold stars on Mac Chrome.\n\nRendering 7-point Likert item\n=============================\n\nRendering a 7-point Likert (or an n-point Likert) is simple. Append the maximum number of stars to the filter as a parameter::\n\n {{ survey.i_like_snakes|bs_stars_3:7 }}\n\nFilters available\n=================\n\nBootstrap\n---------\n\nFor Bootstrap 2 & 3::\n\n {% load likert_bs_stars %}\n\n # Bootstrap 2\n {{ survey.i_like_snakes|bs_stars_2 }}\n\n # Bootstrap 3\n {{ survey.i_like_snakes|bs_stars_3 }}\n\nFont Awesome\n------------\n\nFor Font Awesome 3 & 4::\n\n {% load likert_fa_stars %}\n\n # Font Awesome 3\n {{ survey.i_like_snakes|fa_stars3 }}\n\n # Font Awesome 4\n {{ survey.i_like_snakes|fa_stars4 }}\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-likert-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-likert-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-likert-field issue tracker https://github.com/kelvinwong-ca/django-likert-field/issues\n\nLinks\n=====\n\n* https://pypi.python.org/pypi/django-likert-field/\n* https://github.com/kelvinwong-ca/django-likert-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-likert-field", "keywords": "Likert,ratings,star-rating,star-classification,Django,model-field,Django-Likert-Field", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-likert-field", "package_url": "https://pypi.org/project/django-likert-field/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-likert-field/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kelvinwong-ca/django-likert-field" }, "release_url": "https://pypi.org/project/django-likert-field/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "A Likert field for Django models", "version": "0.2.0" }, "last_serial": 1862543, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "454f1096e12ec8d0d138ec8c34db6278", "sha256": "aa4565b316a2eb5f123ae2da1d332b52e671b445bbebef15ca03bce74b08a5f1" }, "downloads": -1, "filename": "django-likert-field-0.0.1.tar.gz", "has_sig": true, "md5_digest": "454f1096e12ec8d0d138ec8c34db6278", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4964, "upload_time": "2014-03-10T01:11:09", "url": "https://files.pythonhosted.org/packages/84/c5/e260400ca451236718d81f6b873640bff69b0a633e441706b91d18db9542/django-likert-field-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "46808e8f601e60f27859685df5d92b2d", "sha256": "a19c1ebadf0d95f662ddd70cb3dbd52e74c745e7f57067c58870e0d5c6c4d77b" }, "downloads": -1, "filename": "django-likert-field-0.0.2.tar.gz", "has_sig": true, "md5_digest": "46808e8f601e60f27859685df5d92b2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5019, "upload_time": "2014-03-10T03:21:03", "url": "https://files.pythonhosted.org/packages/df/e2/f1b44e0269a8f64fe0bea09587ab58747ac827210706e79eb900bca11bb1/django-likert-field-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "8a8380e7bb6789f6970d1e411a2cc4de", "sha256": "4666c6ac405ddf300fccb9a500d0918b949f38583700f7ca229dc2ffa5fd698c" }, "downloads": -1, "filename": "django-likert-field-0.0.3.tar.gz", "has_sig": true, "md5_digest": "8a8380e7bb6789f6970d1e411a2cc4de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5533, "upload_time": "2014-03-10T05:40:35", "url": "https://files.pythonhosted.org/packages/7b/96/d6845dbeca31db5db7f07752fc15e30b9b12b7f272ca031dd84dea20d948/django-likert-field-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "3dc8602e57b43fcf6a8a48fb6c688011", "sha256": "41f7a43472e525dc969919ce7b4a8592576fbf381941e895d4359ad9f91374f4" }, "downloads": -1, "filename": "django-likert-field-0.0.4.tar.gz", "has_sig": true, "md5_digest": "3dc8602e57b43fcf6a8a48fb6c688011", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5545, "upload_time": "2014-03-10T05:50:11", "url": "https://files.pythonhosted.org/packages/02/3b/9d0a49242eb9bb9e48d42e5cd21a0aaa8a612ea5b150d657e3f160bb847a/django-likert-field-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "dc2a0fa17b2e70d29912770d1daf3c58", "sha256": "4950086e555a3edca133d755885592755456bd54cc760744cdc4ff417dd7c30d" }, "downloads": -1, "filename": "django-likert-field-0.0.5.tar.gz", "has_sig": true, "md5_digest": "dc2a0fa17b2e70d29912770d1daf3c58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6730, "upload_time": "2014-03-14T03:38:15", "url": "https://files.pythonhosted.org/packages/09/66/c783ad20e7079b9a92649dbca6fc6d067bf04855e9e5b70e1c9f33440fcb/django-likert-field-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "984f944b0965aa5f7f9924af66faa43f", "sha256": "9afa88b7e0ee46b11aeb0a530618c32dbc3e088695dfafc8ce8148e3ec291dfa" }, "downloads": -1, "filename": "django-likert-field-0.0.6.tar.gz", "has_sig": true, "md5_digest": "984f944b0965aa5f7f9924af66faa43f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7185, "upload_time": "2014-03-14T19:45:06", "url": "https://files.pythonhosted.org/packages/a8/9e/f7c43fa3be9eecabcfabf603e2a1253f8af18abca9ba26e977009d237ddb/django-likert-field-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "4a26e6337f4d4f36ce1f37499241ad91", "sha256": "4a9c50c9b98b90788b8f00605859e3d829ecfa35d193fbf189e9a80c08cc009f" }, "downloads": -1, "filename": "django-likert-field-0.0.7.tar.gz", "has_sig": true, "md5_digest": "4a26e6337f4d4f36ce1f37499241ad91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7923, "upload_time": "2014-03-15T07:01:39", "url": "https://files.pythonhosted.org/packages/f0/b8/41e73c3b3eb489bdeb0c9565fa76dba4190fe2216e51e5f9497bb0e9bf5b/django-likert-field-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "a685f47b30d51fe423ce786df4dbfce0", "sha256": "35252a37db5b52a2470eea3bb0836bd76a6fc58cb95adb5e1d1794716fd369bb" }, "downloads": -1, "filename": "django-likert-field-0.0.8.tar.gz", "has_sig": true, "md5_digest": "a685f47b30d51fe423ce786df4dbfce0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8173, "upload_time": "2014-03-15T22:27:19", "url": "https://files.pythonhosted.org/packages/28/cf/97d70bab16ac46284d4c8f93b5d04eaecd0c78a4b140703c0602c3e63383/django-likert-field-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "b3cae81524cb3c59ee23b992c8f735d3", "sha256": "2a8e56908bb71f771f10c1f46647a4788680b38b0996733dbd4c9fc031220f57" }, "downloads": -1, "filename": "django-likert-field-0.0.9.tar.gz", "has_sig": true, "md5_digest": "b3cae81524cb3c59ee23b992c8f735d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28011, "upload_time": "2014-03-16T10:26:14", "url": "https://files.pythonhosted.org/packages/8e/d5/c437abad22674d654f3405785c5c8956078411ec2835efa62b4fd3e3bea8/django-likert-field-0.0.9.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "2ab9ced6055c6e3a2fea5fcf003b4aac", "sha256": "22d66a11216ae561df011218bd06ec20656c00eed86f7bbc6644aff9d9492902" }, "downloads": -1, "filename": "django-likert-field-0.1.0.tar.gz", "has_sig": true, "md5_digest": "2ab9ced6055c6e3a2fea5fcf003b4aac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28209, "upload_time": "2014-03-27T21:18:57", "url": "https://files.pythonhosted.org/packages/bc/db/34f0c168b6c88632ba6dac67cb942b1381bc1e419aa22f4e242323a61508/django-likert-field-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1a1d0ca2a2f37aa8e96a09d395f8cc1a", "sha256": "0963c2b6f45c8dfb172519bd14089257ae7b04635fff8648859ea4a7da508446" }, "downloads": -1, "filename": "django-likert-field-0.2.0.tar.gz", "has_sig": true, "md5_digest": "1a1d0ca2a2f37aa8e96a09d395f8cc1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31271, "upload_time": "2015-12-15T00:26:07", "url": "https://files.pythonhosted.org/packages/42/91/20165ea5f5805c9005021d2b965330c7aa6cc38e582bb1ce10ef6c1a4c9b/django-likert-field-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1a1d0ca2a2f37aa8e96a09d395f8cc1a", "sha256": "0963c2b6f45c8dfb172519bd14089257ae7b04635fff8648859ea4a7da508446" }, "downloads": -1, "filename": "django-likert-field-0.2.0.tar.gz", "has_sig": true, "md5_digest": "1a1d0ca2a2f37aa8e96a09d395f8cc1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31271, "upload_time": "2015-12-15T00:26:07", "url": "https://files.pythonhosted.org/packages/42/91/20165ea5f5805c9005021d2b965330c7aa6cc38e582bb1ce10ef6c1a4c9b/django-likert-field-0.2.0.tar.gz" } ] }