{ "info": { "author": "Harel Malka", "author_email": "harel@harelmalka.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=============\nFeed Gov Back\n=============\n\nA small API enabled framework for adding user feedback forms to existing applications within GOV.uk (or other apps).\n\n\nQuick start\n-----------\n\n- Install the package::\n\n pip install feed-gov-back\n\n\n- Add `feedback` to your ``INSTALLED_APPS`` in your ``settings``::\n\n INSTALLED_APPS = [\n ...\n 'feedback',\n ]\n\n- Include the feedback URLconf in your project urls.py like this::\n\n path('feedback/', include('feedback.services.urls'))\n\n or if not using the Api:\n\n path('feedback/', include('feedback.urls'))\n\n- Run migrations and load fixtures::\n\n ./manage.py migrate\n ./manage.py loaddata path/to/fedback/fixtures/*.json\n\n\nUsing Make\n----------\nThe ``Makefile`` provides some handy commands::\n\n make test # run all tests\n make sdist # run python setup.py sdist to create a local installable\n\n\n\nHow it works\n-------------\nA ``FeedbackForm`` contains one or more ``FormElement`` models of different ``ElementType``. These\nmodels represent the form and it's elements.\nThe data is collected for each submission into ``FeedbackCollection`` which contain ``FeedbackData`` records for\neach form element submitted.\n\nAs a form can be placed in different parts of a web resource, ``Placement`` records can be created to\ngroup together form data submitted for different parts of the application. Placements do not have\nto be created upfront, and can be generated on the fly by providing a unique placement key with the form.\n\nA REST Api is exposed to allow manipulating the models externally, which is useful when this is deployed\ninto a backend service.\n\nIn addition, a view to accept form submissions is provided, as well as template tags to render a complete form\nor part of it.\n\nForms can be built via the Api, Models or simply created via the Django admin or even fixtures.\n\n\nElement Types\n-------------\nThere are 3 element types defined: scale, large text area and text input. Scale elements can receive\n``options`` to override defaults. The options and defaults are::\n\n {\n \"min\": 1,\n \"max\": 5,\n \"min_label\": \"Poor\",\n \"max_label\": \"Excellent\",\n \"type\": int\n }\n\n It is also possible to explicitly define the scale labels by providing a list of labels instead of the min/max\n combination\n\n ``labels: [\"great\", \"indifferent\", \"poor\"]``\n\n In this case the \"type\" property of the options should be changed to ``str``\n\nFields can be rendered by the ``form_element`` template tag provided or manually in your templates.\n\n\nData collection\n---------------\nData is collected into the ``FeedbackData`` model, grouped into ``FeedbackCollection`` entries.\nAs feedback forms can be used in different parts of an application, the model expects a ``Placement`` to tell\nit which part of the application or website this form relates to. If a placement is not provided explicitly,\na default one will be used. Placement ids can also be provided in runtime by simply providing it as a string.\nNew ``Placement`` records will be created.\n\n\nSettings\n--------\n\nThe following settings are expected in your Django application\n\n======================= ================================================\nSetting Description\n======================= ================================================\nAUTH_USER_MODEL A path to the User model. Defaults to ``auth.User``\nDEFAULT_PLACEMENT_KEY A key to use as default placement if one is not provided. Defaults to ``DEFAULT``\nANONYMOUS_COLLECTION A boolean to determine if to force anonymous collection or retain the user if available. Defaults to ``True``\nMANAGED_FEEDBACK_MODELS Set to False to prevent the creation of database models. Defaults to ``True``\n======================= ================================================\n\nUsage\n-----\n\nTo include a complete feedback form::\n\n {% load feedback_form %}\n {% feedback_form request 'FORM_REFERENCE' %}\n\nor to include a specific placement::\n\n {% feedback_form request 'FORM_REFERENCE' 'PLACEMENT_ID' %}\n\n\nNote that the feedback_form tag requires the request to pass through it in order toe generate the csrf_token.\n\n\n*One important note* regarding FORM_REFERENCE shown in the tag example above: FORM_REFERENCE can be either a\nFeedback form unique key, it's unique UUID, the form Model instance itself, or a dict representation of the form.\nThis allows for different usage pattern, depending on where this package is installed.\nFor example, if Feedback forms are to be used across a service which is made of an API and a UI layer as separate\napplications, the API can install the package allowing for model creation but obviously not using the templatetags\nas it has no rendering responsibility. The UI however can install the package, disabling model management and only\nuse the tags, by passing the dict returned from the API call. Note that in the case of passing a form model or dict\nthe single quotes should be omitted. The example application demonstrates this concept.\n\n\nStyling\n-------\nThe implemented template tags wrap the entire form in a div with id ``feedback-form``.\nSubsequently, each element is div wrapped with a class ``feedback-form-element``.\nThe submit button is classed with ``feedback-form-button``.\nWithin each element the following divs wrap the name, label and description fields:\n``feedback-form-element-name``, ``feedback-form-element-label`` and ``feedback-form-element-description``\n\n\nExample App\n-----------\nThe ``example`` directory contains a simple django project that utilises the feedback lib.\nIt provides a docker contained postgres db which can be built to isolate the example.\nThe make file allows for installation of the library based on a local sdist build.\n\nTo run it, create a virtual environment and activate it.\nThen either provide your own database or ``docker-compose up`` to use the docker one.\nStart with::\n\n ./manage.py migrate\n ./manage.py loaddata ./feed/fixtures/*.json\n ./manage.py runserver\n\n- You can create your form via ``http://localhost:8000/admin`` (create a superuser to access the admin)\n- interact with the form via ``http://localhost:8000``\n- load the form using a key only: ``http://localhost:8000/key``\n- load the form using a dict representation of it: ``http://localhost:8000/dict``\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/uktrade/feed-gov-back", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "feed-gov-back", "package_url": "https://pypi.org/project/feed-gov-back/", "platform": "", "project_url": "https://pypi.org/project/feed-gov-back/", "project_urls": { "Homepage": "https://github.com/uktrade/feed-gov-back" }, "release_url": "https://pypi.org/project/feed-gov-back/0.3/", "requires_dist": [ "psycopg2-binary", "Django", "djangorestframework" ], "requires_python": "", "summary": "A small framework for API enabled customisable feedback forms", "version": "0.3" }, "last_serial": 5672256, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "d5336f19f642f58e4aabba1e9710fe64", "sha256": "3d2789ed01b71f7d61dea1f7ff22c963f268fb6c93d5ea45f18c73752361770d" }, "downloads": -1, "filename": "feed_gov_back-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d5336f19f642f58e4aabba1e9710fe64", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21624, "upload_time": "2019-01-09T14:17:30", "url": "https://files.pythonhosted.org/packages/ab/fb/01957ce494abbe7246230523e2b34087c1196785d4a5084180a4223a4647/feed_gov_back-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "25c88b0e6b80772785e041f3483e381b", "sha256": "69e1dc0d4f4b827435d7d72c7c537c33363c6318e16ff4ba8cf4e30bacf62709" }, "downloads": -1, "filename": "feed-gov-back-0.2.tar.gz", "has_sig": false, "md5_digest": "25c88b0e6b80772785e041f3483e381b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14831, "upload_time": "2019-01-09T14:17:32", "url": "https://files.pythonhosted.org/packages/df/5c/64f304394b147b59a0417c813f646da1d547985f369ec09005ddee2b5ba1/feed-gov-back-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "d92e280e16c2968264eb02b2e5d654d9", "sha256": "009ab83a0d31903fc2460535a4e77e0fa3f8ce0762ffd71ba28aeeeb2ad9db65" }, "downloads": -1, "filename": "feed_gov_back-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d92e280e16c2968264eb02b2e5d654d9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24284, "upload_time": "2019-08-13T14:49:09", "url": "https://files.pythonhosted.org/packages/9f/9a/4c34e2e6e6db00a12e96919d37a413b82b189fdf577b628fc6e4bffe9e83/feed_gov_back-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12e129bc55d54c8a03fed73fcaed62ad", "sha256": "302953b9320edf424aa438b6b68dda8aa1e6c3aff5f7168f960784895e8b1d64" }, "downloads": -1, "filename": "feed-gov-back-0.3.tar.gz", "has_sig": false, "md5_digest": "12e129bc55d54c8a03fed73fcaed62ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14840, "upload_time": "2019-08-13T14:49:11", "url": "https://files.pythonhosted.org/packages/bf/2c/ab3aea97a69bd8dc1a968dac2699b6e7a06d9e046575414a09f979355a08/feed-gov-back-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d92e280e16c2968264eb02b2e5d654d9", "sha256": "009ab83a0d31903fc2460535a4e77e0fa3f8ce0762ffd71ba28aeeeb2ad9db65" }, "downloads": -1, "filename": "feed_gov_back-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d92e280e16c2968264eb02b2e5d654d9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24284, "upload_time": "2019-08-13T14:49:09", "url": "https://files.pythonhosted.org/packages/9f/9a/4c34e2e6e6db00a12e96919d37a413b82b189fdf577b628fc6e4bffe9e83/feed_gov_back-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12e129bc55d54c8a03fed73fcaed62ad", "sha256": "302953b9320edf424aa438b6b68dda8aa1e6c3aff5f7168f960784895e8b1d64" }, "downloads": -1, "filename": "feed-gov-back-0.3.tar.gz", "has_sig": false, "md5_digest": "12e129bc55d54c8a03fed73fcaed62ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14840, "upload_time": "2019-08-13T14:49:11", "url": "https://files.pythonhosted.org/packages/bf/2c/ab3aea97a69bd8dc1a968dac2699b6e7a06d9e046575414a09f979355a08/feed-gov-back-0.3.tar.gz" } ] }