{ "info": { "author": "Ashish Kumar", "author_email": "ak.ashish2108@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "==============================\nDIAFO :: Django Dynamic Form\n==============================\n\nDiafo is a simple Django app for generating dynamic forms during the runtime. \n\nDetailed documentation is in the \"docs\" directory.\n\n\nRequirements\n------------\n\n* **Python**: 3.4, 3.5, 3.6\n* **Django**: 1.11, 2.0b\n* **Django bootstrap form**: 1.4\n\n\nInstallation\n------------\n\n1. Install using pip:\n\n.. code-block:: sh\n\n pip3 install diafo\n pip3 install django-bootstrap-form\n\n2. Then add ``'django_filters'`` to your ``INSTALLED_APPS``.\n\n.. code-block:: python\n\n INSTALLED_APPS = [\n ...\n 'diafo',\n\t'bootstrapform',\n ]\n\n3. Include the polls URLconf in your project urls.py like this::\n\n url(r'^diafo/', include('diafo.urls')),\n\n4. Run `python manage.py migrate` to create the diafo models.\n\n\n\nUsage\n-----\n\nDiafo can be used for generating questionnaires consisting various questions during runtime. One can specify the question type like CharField, TextFied, ChoiceField, MultipleChoiceField, etc. Requirement can also be mentioned whether the question is compulsary or not. \n\nLet see its usage through a simple survey webapp.\n\n.. code-block:: python\n\n from diafo.models import Questionnaire\n\n class Survey(models.Model):\n\ttitle = models.CharField(max_length=200)\n #link the form to your model\n\tquestionnaire = models.OneToOneField(Questionnaire, null=True)\n\n \n\n\nAnd then in your view you could do:\n\n.. code-block:: python\n\n def new_survey(request):\n\t...\n #get the title by using form or any how..\n\tquestionnaire = Questionnaire.objects.create(name=tilte)\n survey = Survey.objects.create(title=title, questionnaire = questionnaire)\n\treturn HttpResponseRedirect(reverse('diafo:admin_view', kwargs={'pk': survey.form.pk}))\n\n\n \n \nSo now that you have questionnaire linked to your model,you can add questions and edit the questionnaire thru the diafo:admin_view,\nand let the user fill the questionnaire through diafo:user_view.\n\n\nThe diafo main URLs are as follows:\n\n.. code-block:: python\n\n urlpatterns = [\n\t# for adding question,editing questionnaire detail,seeing responses,etc\n\turl(r'^admin/(?P[0-9a-f-]+)/$', views.admin_view, name='admin_view'),\n # for normal users to fill the questionnaire(no edit rights)\n url(r'^user/view/(?P[0-9a-f-]+)/$',views.user_view, name = 'user_view'),\n ]\n\n\nThe Questionnaire model is as follows:\n\n.. code-block:: python\n\n class Questionnaire(models.Model):\t\n\tname = models.CharField(max_length=200, null=True)\n\t# id used for admin purpose.. used as pk in admin view\n\t#id and pk are same since primary key is True\n \tid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)\n\t# view_id - used for normal user (can only see and fill the questionnaire)\n\tview_id = models.CharField(max_length=50,unique=True, default=uuid.uuid4)\n\t#specific settings (can be edited thru diafo admin view for given questionnaire) \n \trequires_sign_in = models.BooleanField(default = False, blank = True)\n \tcollect_identity = models.BooleanField(default = False, blank = True)\n\n\nThis is how you can use use the diafo in your views or templates.\n\n.. code-block:: python\n\n class yourview(request,your_parameters):\n\t... \n\t# get the questionnare object.\n\tif want_to_go_on_admin_view:\n\t # use questionnare.pk and diafo:admin_view\n\t #for use in template href={% url 'diafo:admin_view' questionnaire.pk %}\n\t return HttpResponseRedirect(reverse('diafo:admin_view', kwargs={'pk':questionnaire.pk}))\n\telif want_a_rendered_form_for_user:\n\t # use questionnaire.view_pk and diafo:user_view\n\t #for use in template href={% url 'diafo:user_view' questionnaire.view_id %}\n\t return HttpResponseRedirect(reverse('diafo:admin_view', kwargs={'view_id':questionnaire.view_id}))\n\t\t\t\n\t\t\n\t\n\n\nSupport\n-------\n\nIf you have questions about usage or development you can contact me.\n\nBugs\n----\n\nReally? Oh well... Please Report. Or better, fix :)", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aasis21", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "diafo", "package_url": "https://pypi.org/project/diafo/", "platform": "", "project_url": "https://pypi.org/project/diafo/", "project_urls": { "Homepage": "https://github.com/aasis21" }, "release_url": "https://pypi.org/project/diafo/1.0/", "requires_dist": null, "requires_python": "", "summary": "A simple Django app to generate dynamic forms during runtime", "version": "1.0" }, "last_serial": 3365947, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "90ae60e5cbdfe3632dd5fd8f80a5520c", "sha256": "d8b51f27036ce43bc6d8f7fd3fdbe646639084688a9892f764beb7cdacafca3b" }, "downloads": -1, "filename": "diafo-1.0.tar.gz", "has_sig": false, "md5_digest": "90ae60e5cbdfe3632dd5fd8f80a5520c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9542863, "upload_time": "2017-11-26T20:04:18", "url": "https://files.pythonhosted.org/packages/4d/a4/725d0b435d3ecda77abdb0cc0c190b1f62f009e5eefc6d372cf75377597f/diafo-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "90ae60e5cbdfe3632dd5fd8f80a5520c", "sha256": "d8b51f27036ce43bc6d8f7fd3fdbe646639084688a9892f764beb7cdacafca3b" }, "downloads": -1, "filename": "diafo-1.0.tar.gz", "has_sig": false, "md5_digest": "90ae60e5cbdfe3632dd5fd8f80a5520c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9542863, "upload_time": "2017-11-26T20:04:18", "url": "https://files.pythonhosted.org/packages/4d/a4/725d0b435d3ecda77abdb0cc0c190b1f62f009e5eefc6d372cf75377597f/diafo-1.0.tar.gz" } ] }