{ "info": { "author": "Python Discord", "author_email": "staff@pythondiscord.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# django-crispy-bulma\n\n**This project is an early work in progress. You should not use this package yet, as it is poorly documented and is missing many important features. We'll remove this header when it's ready to use.**\n\n## About\n\nThis is a Django application to add `django-crispy-forms` layout objects for [Bulma](https://bulma.io/). \nIt is a fork of [crispy-forms-bulma](https://github.com/jhotujec/crispy-forms-bulma) by Jure Hotujec, with the intention \nof adding support for Django 2.0+, as well as for components found in the bulma-extensions library.\n\n## Installation\n\nYou can install `django-crispy-bulma` from [PyPI](https://pypi.org/project/django-crispy-bulma/) by running `pip install django-crispy-bulma`. Make sure you also have `django-crispy-forms` installed, as it will not work without it. In order to activate it, you'll need to modify your projects `settings.py` file. \n\nFirst, add `django-crispy-bulma` to your `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = [\n 'crispy_forms',\n 'django_crispy_bulma',\n # ...\n]\n```\n\nNext, add the following to the bottom of the file in order to configure `crispy_forms` to use the **bulma** template pack:\n```python\nCRISPY_ALLOWED_TEMPLATE_PACKS = (\n \"bootstrap\",\n \"uni_form\",\n \"bootstrap3\",\n \"bootstrap4\",\n \"bulma\",\n)\n\nCRISPY_TEMPLATE_PACK = \"bulma\"\n```\n\nYou may also need to use Layout objects or form objects from `django_crispy_bulma` in order to build certain objects, like the UploadField. See the documentation below for specifics on objects like these.\n\nEmailField\n----------\n\nThe EmailField looks like this:\n\n![EmailField](https://i.imgur.com/IBioO0Y.gif)\n\nAn EmailField can be created simply, like any other field in your form. For example:\n\n```python\nfrom django.forms import Form\nfrom django_crispy_bulma.forms import EmailField\n\nclass MyForm(Form):\n my_email = EmailField(\n label=\"email\",\n required=True\n )\n```\n\n\nIconField\n---------\n\nIf you'd like to render a field with an icon in it, you'll need to make use of the Crispy Forms layout object,\nand the `IconField` from our package. See below for an example:\n\n![IconField](https://i.imgur.com/tHsPHrM.png)\n\n```python\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.layout import Layout\nfrom django.forms import Form, CharField\n\nfrom django_crispy_bulma.layout import IconField\n\nclass SetupForm(Form):\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n\n self.helper = FormHelper(self)\n\n self.helper.layout = Layout(\n IconField(\"username\", icon_prepend=\"user\"),\n )\n\n username = CharField(\n label=\"Username\",\n required=True,\n )\n```\n\nNote that `IconField` also supports an `icon_append` keyword argument. This field only supports font-awesome icons.\n\nUploadField\n-----------\n\nThe UploadField looks like this:\n\n![UploadField](https://i.imgur.com/hCv7g9K.gif)\n\nTo create these with CrispyForms, you'll need both a form object and a layout object from our package. Here's an example of how to use them.\n```python\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.layout import Layout\nfrom django import forms\nfrom django_crispy_bulma.layout import UploadField\nfrom django_crispy_bulma.forms import ImageField, FileField\n\nclass MyForm(forms.Form):\n my_image = ImageField(\n label=\"Upload an image of your dog\",\n required=False\n )\n my_file = FileField(\n label=\"Upload your actual dog in .dog format\",\n required=True \n )\n\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n self.helper = FormHelper()\n\n self.helper.layout = Layout(\n UploadField(\"my_image\"),\n UploadField(\"my_file\"),\n )\n```\n\nA little bit of javascript is needed in order to get the filename to display after a file upload is successful.\n\nWritten in vanilla JS, this might look something like this:\n\n```javascript\nwindow.onload = function() {\n // Apply this to all upload fields\n const upload_fields = document.querySelectorAll(\".file\");\n for (let i = 0; i < upload_fields.length; i++) {\n let input = upload_fields[i].querySelector(\".file-input\");\n let filename = upload_fields[i].querySelector(\".file-name\");\n\n input.onchange = function() {\n filename.textContent = input.files[0].name;\n }\n }\n};\n```\n\nFor your convenience, we provide a script that handles this in our companion package, [django-simple-bulma](https://github.com/python-discord/django-simple-bulma). We highly recommend you use these two packages together. \n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/python-discord/django-crispy-bulma", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-crispy-bulma", "package_url": "https://pypi.org/project/django-crispy-bulma/", "platform": "", "project_url": "https://pypi.org/project/django-crispy-bulma/", "project_urls": { "Homepage": "https://github.com/python-discord/django-crispy-bulma" }, "release_url": "https://pypi.org/project/django-crispy-bulma/0.1.2/", "requires_dist": [ "Django (>=2.0)", "django-crispy-forms (==1.7.2)", "flake8 ; extra == 'dev'", "flake8-bugbear ; extra == 'dev'", "flake8-import-order ; extra == 'dev'", "flake8-tidy-imports ; extra == 'dev'", "flake8-todo ; extra == 'dev'", "flake8-string-format ; extra == 'dev'", "pdoc ; extra == 'dev'", "pre-commit ; extra == 'dev'", "PyGithub ; extra == 'dev'", "wheel ; extra == 'dev'" ], "requires_python": "", "summary": "Django application to add 'django-crispy-forms' layout objects for Bulma.io", "version": "0.1.2" }, "last_serial": 5049606, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "38a9cdef66ad2471df7b2d6784901ebb", "sha256": "8580677ce3403ea0aa32cc45a85438c9bc01fb97ad3c300c824e7f2ee1660e00" }, "downloads": -1, "filename": "django_crispy_bulma-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "38a9cdef66ad2471df7b2d6784901ebb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30599, "upload_time": "2019-01-13T20:54:24", "url": "https://files.pythonhosted.org/packages/d3/3c/491bfaa3ae327446192937f75a269698a7daa29a1a2437cbd83d1d382bd3/django_crispy_bulma-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f175c55ff2f4385934223cadd67c8905", "sha256": "09dffe4492accd98fbf39380e03218618a8f2905fa0967824cfcebf04f42a7af" }, "downloads": -1, "filename": "django-crispy-bulma-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f175c55ff2f4385934223cadd67c8905", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13126, "upload_time": "2019-01-13T20:54:26", "url": "https://files.pythonhosted.org/packages/a2/87/7c2e9dff491f48f486821b4d2ecae88220902597650b14302178a4a32fa4/django-crispy-bulma-0.0.1.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "4fc13a40b104499735ce6a6255ce17cb", "sha256": "84632a26e4848d0ea31ed9602b77046fa54018774ac5141c9a520a4eb830fee7" }, "downloads": -1, "filename": "django_crispy_bulma-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "4fc13a40b104499735ce6a6255ce17cb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30640, "upload_time": "2019-01-13T21:13:18", "url": "https://files.pythonhosted.org/packages/02/47/1ee75ada25e4473889b0e858bf639ca76b26022d6f368f3d27d074476771/django_crispy_bulma-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f402be6c7e3d5c169211e9c859f563ec", "sha256": "73361983f5d6d055647395a75571f184bd660f8e433c19b034473a01e9e74f38" }, "downloads": -1, "filename": "django-crispy-bulma-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f402be6c7e3d5c169211e9c859f563ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13185, "upload_time": "2019-01-13T21:13:19", "url": "https://files.pythonhosted.org/packages/d7/75/fc799be3785bd30b6fafd28bd5aa08225f16dbef1376b63f3915e3b61b20/django-crispy-bulma-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "7f617a918b373b9d59d262f08780b4e2", "sha256": "98ba9f3380a9c18e8adbab4400c366ce2ffd9ca0922c7570e730e35e965994d3" }, "downloads": -1, "filename": "django_crispy_bulma-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7f617a918b373b9d59d262f08780b4e2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30658, "upload_time": "2019-01-13T22:57:39", "url": "https://files.pythonhosted.org/packages/7a/e5/59d1a43548953008b0a43847efee2699b32bb3efb5bdd500a4c22117efea/django_crispy_bulma-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "119498882c51fb4472a82d0c96cef244", "sha256": "3fb773ef62b7d1cbb0091969773b4832565897fcb864ee6e8ef6e9d6c5b87e77" }, "downloads": -1, "filename": "django-crispy-bulma-0.1.0.tar.gz", "has_sig": false, "md5_digest": "119498882c51fb4472a82d0c96cef244", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13303, "upload_time": "2019-01-13T22:57:41", "url": "https://files.pythonhosted.org/packages/02/85/534c14a9c17fabb89847c79a52303289b47e55f5e628cfe92d11eb9e498e/django-crispy-bulma-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a9ca407f1cd1f7a11f09335e3590def6", "sha256": "eebc9708c9ab46a4191e9641ef75b9e13bed1708905acc3f82481cc343889fe0" }, "downloads": -1, "filename": "django_crispy_bulma-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a9ca407f1cd1f7a11f09335e3590def6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30833, "upload_time": "2019-01-14T23:25:57", "url": "https://files.pythonhosted.org/packages/b1/e0/0b463cb0c77d8fc5adb32bf35829e5349db40f18dfc10c2cfa4797bd68fd/django_crispy_bulma-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "898eb6bf9738c8e96f94f3044a13fccc", "sha256": "430a8a680b0e5c045204f612ec37e3a0d61fd7b36f71b3fd198a1c8adfd789e4" }, "downloads": -1, "filename": "django-crispy-bulma-0.1.1.tar.gz", "has_sig": false, "md5_digest": "898eb6bf9738c8e96f94f3044a13fccc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13680, "upload_time": "2019-01-14T23:25:59", "url": "https://files.pythonhosted.org/packages/2b/a5/0bb535546126adaae180a0ee01749deaf5374265f2c496abaf4a6946afe6/django-crispy-bulma-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "95c9b02b4203c403ff16fc12c6c503d5", "sha256": "2067cce1f481f9f6fcbcde86eb314eb4d5786e5a955907e1fd8359f319191b91" }, "downloads": -1, "filename": "django_crispy_bulma-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "95c9b02b4203c403ff16fc12c6c503d5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31482, "upload_time": "2019-04-02T12:58:37", "url": "https://files.pythonhosted.org/packages/a1/51/9d1d55b9fd102e0ded6ba63e82a2a6ac4d076dcf5f150af9af7c4458c1b4/django_crispy_bulma-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c8b72e4eb13a3831557e25ab3b224ba", "sha256": "0d982e217a95706e0bbecd9f43990c191b071a20287478c7847ff096567e6e64" }, "downloads": -1, "filename": "django-crispy-bulma-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9c8b72e4eb13a3831557e25ab3b224ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14693, "upload_time": "2019-04-02T12:58:39", "url": "https://files.pythonhosted.org/packages/b1/a3/c5f57c9e2d0dd69b6e7b0b68e92c443125a499a6a9807ce64f834b1a225d/django-crispy-bulma-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "95c9b02b4203c403ff16fc12c6c503d5", "sha256": "2067cce1f481f9f6fcbcde86eb314eb4d5786e5a955907e1fd8359f319191b91" }, "downloads": -1, "filename": "django_crispy_bulma-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "95c9b02b4203c403ff16fc12c6c503d5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31482, "upload_time": "2019-04-02T12:58:37", "url": "https://files.pythonhosted.org/packages/a1/51/9d1d55b9fd102e0ded6ba63e82a2a6ac4d076dcf5f150af9af7c4458c1b4/django_crispy_bulma-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c8b72e4eb13a3831557e25ab3b224ba", "sha256": "0d982e217a95706e0bbecd9f43990c191b071a20287478c7847ff096567e6e64" }, "downloads": -1, "filename": "django-crispy-bulma-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9c8b72e4eb13a3831557e25ab3b224ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14693, "upload_time": "2019-04-02T12:58:39", "url": "https://files.pythonhosted.org/packages/b1/a3/c5f57c9e2d0dd69b6e7b0b68e92c443125a499a6a9807ce64f834b1a225d/django-crispy-bulma-0.1.2.tar.gz" } ] }