{ "info": { "author": "Munim Munna", "author_email": "monim67@yahoo.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "django-flatpickr\n================\n\nThis django widget contains Date-Picker, Time-Picker, DateTime-Picker input\nwidgets with date-range-picker functionality for django version >= 2.0.\nThe widget implements `flatpickr `_\nto display date-pickers in django model forms and custom forms which can be\nconfigured easily for date-range selection. For Bootstrap date-picker see\n`django-bootstrap-datepicker-plus `_.\n\n\n| |ci-status| |coverage.io|\n| |pyversions| |djversions| |pypi-version|\n| |format| |status| |license|\n\n| |flatpickr-red-theme| |flatpickr-default-theme| |flatpickr-dark-theme|\n\n\n\nDemo\n----\n- `Custom Form `_.\n- `Model Form `_.\n- `Generic View (without Model Form) `_.\n\n\n\nGetting Started\n---------------\n\n\nPrerequisites\n^^^^^^^^^^^^^\n- Python >= 3.4\n- Django >= 2.0\n\n\nInstalling\n^^^^^^^^^^\nInstall the PyPI package via pip.\n\n::\n\n pip install django-flatpickr\n\nAdd ``flatpickr`` to ``INSTALLED_APPS`` in your ``settings.py`` file.\n\n.. code:: python\n\n INSTALLED_APPS = [\n # Add the following\n 'flatpickr',\n ]\n\n\n\nUsage\n-----\n\nThe HTML template must have the following to render the flatpickr widget.\nA better example is `here `_.\n\n.. code:: html\n\n \n {{ form.media }} {# Adds all flatpickr JS/CSS files from CDN #}\n {{ form.as_p }} {# Renders the form #}\n\n\nYou can use it `with generic views without a model form `_.\nIt can also be used with custom forms and model forms as below.\n\n\nUsage in Custom Form\n^^^^^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n # File: forms.py\n from flatpickr import DatePickerInput, TimePickerInput, DateTimePickerInput\n from .models import Event\n from django import forms\n\n class ToDoForm(forms.Form):\n todo = forms.CharField(widget=forms.TextInput())\n date = forms.DateField(widget=DatePickerInput())\n time = forms.TimeField(widget=TimePickerInput())\n datetime = forms.DateTimeField(widget=DateTimePickerInput())\n\n\n # File: views.py\n class CustomFormView(generic.FormView):\n template_name = 'myapp/custom-form.html'\n form_class = ToDoForm\n\n\nSee `models.py `_, `forms.py `_,\n`views.py `_, `custom-form.html `_\nfor more details.\n\nUsage in Model Form\n^^^^^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n # File: forms.py\n from flatpickr import DatePickerInput, TimePickerInput, DateTimePickerInput\n from .models import Event\n from django import forms\n\n class EventForm(forms.ModelForm):\n class Meta:\n model = Event\n fields = ['name', 'start_date', 'start_time', 'start_datetime']\n widgets = {\n 'start_date': DatePickerInput(),\n 'start_time': TimePickerInput(),\n 'start_datetime': DateTimePickerInput(),\n }\n\n\n # File: views.py\n class UpdateView(generic.edit.UpdateView):\n model = Event\n form_class = EventForm\n\n\nSee `models.py `_, `forms.py `_,\n`views.py `_, `event_form.html `_\nfor more details.\n\nImplement date-range-picker\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDatePickers can be linked together to select a date-range, time-range or\ndate-time-range **without writing a single line of JavaScript**.\n\n.. code:: python\n\n # File: forms.py\n from flatpickr import DatePickerInput, TimePickerInput\n from django import forms\n\n class EventForm(forms.ModelForm):\n class Meta:\n model = Event\n fields = ['name', 'start_date', 'end_date', 'start_time', 'end_time']\n widgets = {\n 'start_date':DatePickerInput().start_of('event days'),\n 'end_date':DatePickerInput().end_of('event days'),\n 'start_time':TimePickerInput().start_of('party time'),\n 'end_time':TimePickerInput().end_of('party time'),\n }\n\n\n\nCustomization\n-------------\n\nTo customize the look and features of flatpickr widget copy the\n`settings block `_ to your settings.py file and customize it.\nSettings applies globally to all flatpickr widgets used in your site.\n\nIf you need to customize a single flatpickr widget you can do it as follows:\n\n.. code:: python\n\n class ToDoForm(forms.Form):\n todo = forms.CharField(widget=forms.TextInput())\n date = forms.DateField(widget=DatePickerInput(\n attrs = { # input element attributes\n \"class\": \"my-custom-class\",\n },\n options = { # flatpickr options\n \"dateFormat\": \"m/d/Y\",\n }\n ))\n\n\n\nLicense\n-------\n\n - `MIT LICENSE `_.\n - `CONTRIBUTING `_.\n - `CODE_OF_CONDUCT `_.\n\n\n.. |flatpickr-red-theme| image:: https://cloud.githubusercontent.com/assets/11352152/14549374/3cc01102-028d-11e6-9ff4-0cf208a310c4.PNG\n :alt: Flatpickr Red Theme\n\n.. |flatpickr-default-theme| image:: https://cloud.githubusercontent.com/assets/11352152/14549370/3cadb750-028d-11e6-818d-c6a1bc6349fc.PNG\n :alt: Flatpickr Default Theme\n\n.. |flatpickr-dark-theme| image:: https://cloud.githubusercontent.com/assets/11352152/14549372/3cbc8514-028d-11e6-8daf-ec1ba01c9d7e.PNG\n :alt: Flatpickr Dark Theme\n\n\n.. |ci-status| image:: https://travis-ci.org/monim67/django-flatpickr.svg?branch=master\n :target: https://travis-ci.org/monim67/django-flatpickr\n :alt: Build Status\n\n.. |coverage.io| image:: https://coveralls.io/repos/github/monim67/django-flatpickr/badge.svg?branch=master\n :target: https://coveralls.io/github/monim67/django-flatpickr?branch=master\n :alt: Coverage Status\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/django-flatpickr.svg\n :target: https://pypi.python.org/pypi/django-flatpickr\n :alt: Python Versions\n\n.. |djversions| image:: https://img.shields.io/pypi/djversions/django-flatpickr.svg\n :target: https://pypi.python.org/pypi/django-flatpickr\n :alt: DJango Versions\n\n.. |pypi-version| image:: https://badge.fury.io/py/django-flatpickr.svg\n :target: https://pypi.python.org/pypi/django-flatpickr\n :alt: PyPI version\n\n.. |format| image:: https://img.shields.io/pypi/format/django-flatpickr.svg\n :target: https://pypi.python.org/pypi/django-flatpickr\n :alt: Format\n\n.. |status| image:: https://img.shields.io/pypi/status/django-flatpickr.svg\n :target: https://pypi.python.org/pypi/django-flatpickr\n :alt: Status\n\n.. |license| image:: https://img.shields.io/pypi/l/django-flatpickr.svg\n :target: https://pypi.python.org/pypi/django-flatpickr\n :alt: Licence\n\n\n.. _demo_custom_form: https://monim67.github.io/django-flatpickr/demo/custom-form.html\n.. _demo_model_form: https://monim67.github.io/django-flatpickr/demo/generic-view-with-model-form-1.html\n.. _demo_generic_view: https://monim67.github.io/django-flatpickr/demo/generic-view.html\n\n.. _generic_view_block: https://github.com/monim67/django-flatpickr/blob/v1.0.0/dev/myapp/views.py#L11\n.. _settings_block: https://github.com/monim67/django-flatpickr/blob/v1.0.0/dev/mysite/settings.py#L134-L176\n\n.. _file_custom_form_html: https://github.com/monim67/django-flatpickr/blob/v1.0.0/dev/myapp/templates/myapp/custom-form.html\n.. _file_event_form_html: https://github.com/monim67/django-flatpickr/blob/v1.0.0/dev/myapp/templates/myapp/event_form.html\n.. _file_forms_py: https://github.com/monim67/django-flatpickr/blob/v1.0.0/dev/myapp/forms.py\n.. _file_views_py: https://github.com/monim67/django-flatpickr/blob/v1.0.0/dev/myapp/views.py\n.. _file_models_py: https://github.com/monim67/django-flatpickr/blob/v1.0.0/dev/myapp/models.py\n\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/monim67/django-flatpickr", "keywords": "django flatpickr date-picker time-picker datetime-picker date-range-picker", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-flatpickr", "package_url": "https://pypi.org/project/django-flatpickr/", "platform": "", "project_url": "https://pypi.org/project/django-flatpickr/", "project_urls": { "Homepage": "https://github.com/monim67/django-flatpickr" }, "release_url": "https://pypi.org/project/django-flatpickr/1.0.1/", "requires_dist": [ "django (>=2.0)" ], "requires_python": ">=3.4", "summary": "Flatpickr based DatePickerInput, TimePickerInput and DateTimePickerInput with date-range-picker functionality for django >= 2.0", "version": "1.0.1" }, "last_serial": 4909051, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "a8aff705d06aeb3a808fc3374c283f45", "sha256": "15a69aae857aa32175fd25432ab66457f531c0bd9b13949ad901d9e11680698c" }, "downloads": -1, "filename": "django_flatpickr-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a8aff705d06aeb3a808fc3374c283f45", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 8139, "upload_time": "2019-03-07T07:43:20", "url": "https://files.pythonhosted.org/packages/46/35/d47485e75072408865bb97a87c0280d04a5789182558c8a7fa5648826afb/django_flatpickr-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7550c47536d14f2472f5f2023a4416a0", "sha256": "e194c037fab084e24bc222afcf4479235aa61369f67761f467b3a874e1247639" }, "downloads": -1, "filename": "django-flatpickr-1.0.0.tar.gz", "has_sig": false, "md5_digest": "7550c47536d14f2472f5f2023a4416a0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 6860, "upload_time": "2019-03-07T07:43:22", "url": "https://files.pythonhosted.org/packages/f1/c8/6ca42f35e384ed0afbd01f46beb3b1030504c7dcd0e419c98767e2ab2fcc/django-flatpickr-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "d07a110ecce1ebac61b734a9f7f5ab03", "sha256": "097b45d283ed405879efa3e98a80720ff3a75f7ce1e454d6003c9dd0f1f484e9" }, "downloads": -1, "filename": "django_flatpickr-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d07a110ecce1ebac61b734a9f7f5ab03", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 7581, "upload_time": "2019-03-07T08:46:07", "url": "https://files.pythonhosted.org/packages/b9/ff/93ce91c73be0e6bfbf2e774b90ef3130e13ba84179ec849693cfa9886ecb/django_flatpickr-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76d4dbe3e79af725ffbfc27dd3d76858", "sha256": "a38cce4bfc4638e75bb079271dc7c99f399fc98893164174b234a9c4507bf974" }, "downloads": -1, "filename": "django-flatpickr-1.0.1.tar.gz", "has_sig": false, "md5_digest": "76d4dbe3e79af725ffbfc27dd3d76858", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 7252, "upload_time": "2019-03-07T08:46:10", "url": "https://files.pythonhosted.org/packages/6e/62/4d25c17f8b917f75373ba367565c1d9a1ed24e5728336368f4e7a99d7a5a/django-flatpickr-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d07a110ecce1ebac61b734a9f7f5ab03", "sha256": "097b45d283ed405879efa3e98a80720ff3a75f7ce1e454d6003c9dd0f1f484e9" }, "downloads": -1, "filename": "django_flatpickr-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d07a110ecce1ebac61b734a9f7f5ab03", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 7581, "upload_time": "2019-03-07T08:46:07", "url": "https://files.pythonhosted.org/packages/b9/ff/93ce91c73be0e6bfbf2e774b90ef3130e13ba84179ec849693cfa9886ecb/django_flatpickr-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76d4dbe3e79af725ffbfc27dd3d76858", "sha256": "a38cce4bfc4638e75bb079271dc7c99f399fc98893164174b234a9c4507bf974" }, "downloads": -1, "filename": "django-flatpickr-1.0.1.tar.gz", "has_sig": false, "md5_digest": "76d4dbe3e79af725ffbfc27dd3d76858", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 7252, "upload_time": "2019-03-07T08:46:10", "url": "https://files.pythonhosted.org/packages/6e/62/4d25c17f8b917f75373ba367565c1d9a1ed24e5728336368f4e7a99d7a5a/django-flatpickr-1.0.1.tar.gz" } ] }