{ "info": { "author": "Bryce Groff", "author_email": "bgroff@hawaii.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Utilities" ], "description": "django-timezone-field-ng\n========================\n\n.. image:: https://img.shields.io/travis/bgroff/django-timezone-field-ng/develop.svg\n :target: https://travis-ci.org/bgroff/django-timezone-field-ng/\n\n.. image:: https://img.shields.io/coveralls/bgroff/django-timezone-field-ng/develop.svg\n :target: https://coveralls.io/r/bgroff/django-timezone-field-ng/\n\n.. image:: https://img.shields.io/pypi/dm/django-timezone-field-ng.svg\n :target: https://pypi.python.org/pypi/django-timezone-field-ng/\n\nA Django app providing database and form fields for `pytz`__ timezone objects.\n\nExamples\n--------\n\nDatabase Field\n~~~~~~~~~~~~~~\n\n.. code:: python\n\n import pytz\n from django.db import models\n from timezone_field import TimeZoneField\n\n class MyModel(models.Model):\n timezone1 = TimeZoneField(default='Europe/London') # defaults supported\n timezone2 = TimeZoneField()\n timezone3 = TimeZoneField()\n\n my_inst = MyModel(\n timezone1='America/Los_Angeles', # assignment of a string\n timezone2=pytz.timezone('Turkey'), # assignment of a pytz.DstTzInfo\n timezone3=pytz.UTC, # assignment of pytz.UTC singleton\n )\n my_inst.full_clean() # validates against pytz.common_timezones\n my_inst.save() # values stored in DB as strings\n\n tz = my_inst.timezone1 # values retrieved as pytz objects\n repr(tz) # \"\"\n\n\nForm Field\n~~~~~~~~~~\n\n.. code:: python\n\n from django import forms\n from timezone_field import TimeZoneFormField\n\n class MyForm(forms.Form):\n timezone = TimeZoneFormField()\n\n my_form = MyForm({\n 'timezone': 'America/Los_Angeles',\n })\n my_form.full_clean() # validates against pytz.common_timezones\n\n tz = my_form.cleaned_data['timezone'] # values retrieved as pytz objects\n repr(tz) # \"\"\n\n\nInstallation\n------------\n\n#. From `pypi`__ using `pip`__:\n\n .. code:: sh\n\n pip install django-timezone-field-ng\n\n#. Add `timezone_field` to your `settings.INSTALLED_APPS`__:\n\n .. code:: python\n\n INSTALLED_APPS = (\n ...\n 'timezone_field',\n ...\n )\n\nChangelog\n---------\n\n* 2.0 (2016-09-09)\n\n * Fork the repository from mfogel and tag 2.0 release\n\n* 2.0rc1 (2016-01-31)\n\n * Drop support for django 1.7, add support for django 1.9\n * Drop support for python 3.2, 3.3, add support for python 3.5\n * Remove tests from source distribution\n\n* 1.3 (2015-10-12)\n\n * Drop support for django 1.6, add support for django 1.8\n * Various `bug fixes`__\n\n* 1.2 (2015-02-05)\n\n * For form field, changed default list of accepted timezones from\n `pytz.all_timezones` to `pytz.common_timezones`, to match DB field\n behavior.\n\n* 1.1 (2014-10-05)\n\n * Django 1.7 compatibility\n * Added support for formating `choices` kwarg as `[[, ], ...]`,\n in addition to previous format of `[[, ], ...]`.\n * Changed default list of accepted timezones from `pytz.all_timezones` to\n `pytz.common_timezones`. If you have timezones in your DB that are in\n `pytz.all_timezones` but not in `pytz.common_timezones`, this is a\n backward-incompatible change. Old behavior can be restored by\n specifying `choices=[(tz, tz) for tz in pytz.all_timezones]` in your\n model definition.\n\n* 1.0 (2013-08-04)\n\n * Initial release as `timezone_field`.\n\n\nRunning the Tests\n-----------------\n\n#. Install `tox`__.\n\n#. From the repository root, run\n\n .. code:: sh\n\n tox\n\n Postgres will need to be running locally, and sqlite will need to be\n installed in order for tox to do its job.\n\nFound a Bug?\n------------\n\nTo file a bug or submit a patch, please head over to `django-timezone-field-ng on github`__.\n\nCredits\n-------\nThis project is a fork of the work done by `Mike Fogel's django-timezones`__\n\nAnd was originally adapted from `Brian Rosner's django-timezones`__. The full list of contributors is available on `github`__.\n\n\n__ http://pypi.python.org/pypi/pytz/\n__ http://pypi.python.org/pypi/django-timezone-field-ng/\n__ http://www.pip-installer.org/\n__ https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps\n__ https://github.com/mfogel/django-timezone-field/issues?q=milestone%3A1.3\n__ https://tox.readthedocs.org/\n__ https://github.com/bgroff/django-timezone-field-ng/\n__ https://github.com/mfogel/django-timezones/\n__ https://github.com/brosner/django-timezones/\n__ https://github.com/bgroff/django-timezone-field-ng/graphs/contributors", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/bgroff/django-timezone-field/", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-timezone-field-ng", "package_url": "https://pypi.org/project/django-timezone-field-ng/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-timezone-field-ng/", "project_urls": { "Homepage": "http://github.com/bgroff/django-timezone-field/" }, "release_url": "https://pypi.org/project/django-timezone-field-ng/2.0/", "requires_dist": null, "requires_python": null, "summary": "A Django app providing database and form fields for pytz timezone objects.", "version": "2.0" }, "last_serial": 2334440, "releases": { "2.0": [ { "comment_text": "", "digests": { "md5": "430977da953c8584f3ba65244b2b33cd", "sha256": "d9c9f2850c4edc4f95ee7e80eb2a983a90136e8ad2b4838d9b07c158f56afc52" }, "downloads": -1, "filename": "django-timezone-field-ng-2.0-1.tar.gz", "has_sig": false, "md5_digest": "430977da953c8584f3ba65244b2b33cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5956, "upload_time": "2016-09-09T22:27:47", "url": "https://files.pythonhosted.org/packages/81/50/c746f0667ea2ad078c560aba37b5ec169a9cbded64b8e0e2f849dcea81be/django-timezone-field-ng-2.0-1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "430977da953c8584f3ba65244b2b33cd", "sha256": "d9c9f2850c4edc4f95ee7e80eb2a983a90136e8ad2b4838d9b07c158f56afc52" }, "downloads": -1, "filename": "django-timezone-field-ng-2.0-1.tar.gz", "has_sig": false, "md5_digest": "430977da953c8584f3ba65244b2b33cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5956, "upload_time": "2016-09-09T22:27:47", "url": "https://files.pythonhosted.org/packages/81/50/c746f0667ea2ad078c560aba37b5ec169a9cbded64b8e0e2f849dcea81be/django-timezone-field-ng-2.0-1.tar.gz" } ] }