{ "info": { "author": "The Cut Creative", "author_email": "development@thecut.net.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===============================\nWelcome to thecut-durationfield\n===============================\n\n\n.. image:: https://travis-ci.org/thecut/thecut-durationfield.svg\n :target: https://travis-ci.org/thecut/thecut-durationfield\n\n.. image:: https://codecov.io/github/thecut/thecut-durationfield/coverage.svg\n :target: https://codecov.io/github/thecut/thecut-durationfield\n\n.. image:: https://readthedocs.org/projects/thecut-durationfield/badge/?version=latest\n :target: http://thecut-durationfield.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\nThis app provides a custom Django model field, ``RelativeDeltaField``, and\nrelated form fields and widgets. ``RelativeDeltaField`` stores time durations\nusing `ISO 8601`_ representations, and returns ``dateutil.relativedelta``\nobjects which may be used directly with ``datetime.datetime`` objects.\n\nThis project was inspired by packages such as `django-durationfield`_. However,\nthis project focuses on:\n\n#. providing a database-agnostic, standards-compliant way of storing the\n durations in the database (using `ISO 8601`_).\n#. returning ``dateutil.relativedelta`` objects that can be used to perform\n calculations on ``datetime.datetime`` objects.\n\nNote that `django-durationfield`_ provides the ability to filter querysets\nbased on the relative size of the stored duration, which is not possible with\nthis project. I.e., you can't use ``__lt`` and ``__gt`` etc., when filtering\nby fields provided by this project.\n\n\nDocumentation\n-------------\n\nThe full documentation is at https://thecut-durationfield.readthedocs.org.\n\n\nQuickstart\n----------\n\nInstall ``thecut-durationfield`` using the installation instructions found in the documentation.\n\nModel field\n~~~~~~~~~~~\n\n.. code:: python\n\n from django.db import models\n from datetime import datetime\n from thecut.durationfield.models import RelativeDeltaField\n\n\n class MyModel(models.Model):\n duration = RelativeDeltaField(blank=True, null=True)\n\n\n my_instance = MyModel(duration='P7D')\n datetime(2014, 1, 1) + my_instance.duration # datetime(2014, 1, 8, 0, 0)\n\n\nForm field\n~~~~~~~~~~\n\nTwo form fields are provided: ``RelativeDeltaChoiceField`` and\n``RelativeDeltaTextInput``:\n\n.. code:: python\n\n from django import forms\n from thecut.durationfield.models import RelativeDeltaChoiceField\n\n DURATIONS = [\n ('', 'Never'),\n\t('P7D', 'One week'),\n\t('P1M', 'One month'),\n ]\n\n class MyForm(forms.ModelForm):\n\n duration = RelativeDeltaChoiceField(choices=DURATIONS)\n\n\nor, if you'd prefer to type in the (`ISO 8601`_ compliant) value manually:\n\n.. code:: python\n\n from django import forms\n from thecut.durationfield.forms import RelativeDeltaTextInput\n\n class MyForm(forms.ModelForm):\n\n duration = RelativeDeltaTextInput()\n\n\nCredits\n-------\n\nSee ``AUTHORS.rst``.\n\n\n.. _`ISO 8601`: http://en.wikipedia.org/wiki/ISO_8601#Durations\n.. _`django-durationfield`: https://github.com/johnpaulett/django-durationfield\n.. _`pypi`: http://pypi.python.org/pypi/django-timezone-field/\n.. _`pip`: http://www.pip-installer.org/\n\n.. :changelog:\n\n=======\nHistory\n=======\n\n\n2.0.3 (2016-08-15)\n------------------\n\n* Removed cross-document links from README.rst as it breaks pypi.\n* Small fix to project's setup file.\n\n\n2.0.2 (2016-08-15)\n------------------\n\n* Documentation updates.\n\n\n2.0.1 (2016-08-15)\n------------------\n\n* Documentation fixes.\n* Testing fixes.\n\n\n2.0 (2016-08-15)\n------------------\n\n* Added support for Django 1.10.\n* Removed support for Django < 1.8.\n* Restructured test suite.\n* Restructured documentation.\n\n\n1.0.8 (2015-08-26)\n------------------\n\n* Improved handling of seconds and milliseconds.\n\n\n1.0.8 (2015-08-26)\n------------------\n\n* Improved handling of seconds and milliseconds.\n\n\n1.0.7 (2015-03-17)\n------------------\n\n* Added Python 3 support.\n\n\n1.0.6 (2014-07-28)\n------------------\n\n* Fix an issue which caused an empty ``relativedelta`` to be returned for a\n database NULL value.\n* Get ``tox`` up and running.\n* Update package for public release.\n\n\n1.0.5 (2014-03-19)\n------------------\n\n- Remove ``distribute`` from ``install_requires``.\n\n\n1.0.4 (2013-12-17)\n-------------------\n\n- Fixed an issue with Postgres's fixed-length 64 character field.\n\n\n1.0.3 (2013-09-28)\n------------------\n\n- Minor code cleanup.\n\n\n1.0.2 (20132-08-08)\n-------------------\n\n- Add a Select widget for friendlier form input.\n\n\n1.0.1 (2013-07-25)\n------------------\n\n- Fixes to south introspection rules.\n\n\n1.0 (2013-07-25)\n----------------\n\n- First useful release with base model and form fields.\n\n\n0.1 (2013-06-10)\n----------------\n\n- Initial release, mostly useless.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://projects.thecut.net.au/projects/thecut-durationfield", "keywords": null, "license": "Apache Software License 2.0", "maintainer": null, "maintainer_email": null, "name": "thecut-durationfield", "package_url": "https://pypi.org/project/thecut-durationfield/", "platform": "any", "project_url": "https://pypi.org/project/thecut-durationfield/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://projects.thecut.net.au/projects/thecut-durationfield" }, "release_url": "https://pypi.org/project/thecut-durationfield/2.0.3/", "requires_dist": null, "requires_python": null, "summary": "Form and model fields for storing durations on Django models as ISO 8601 compliant strings, and returning relativedelta objects.", "version": "2.0.3" }, "last_serial": 2281322, "releases": { "1.0.6": [ { "comment_text": "", "digests": { "md5": "eb26634c9d5a8b12005c9e4c043fa30a", "sha256": "2bcd55995cddb5ac73a6bbabfd5bc4e3f599664a1d1d5966f53415e1a3cce488" }, "downloads": -1, "filename": "thecut_durationfield-1.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "eb26634c9d5a8b12005c9e4c043fa30a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 12160, "upload_time": "2014-07-28T07:39:23", "url": "https://files.pythonhosted.org/packages/bb/f5/78b7956f86dbb28658bf022982291e53d3c18d7c3f8ea574d5072f07526a/thecut_durationfield-1.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f316c118638ced2e23ca50745169f442", "sha256": "2269aea3382e86c41a1198e8b069e29254422dc16bebdf23109e3ddb115210a0" }, "downloads": -1, "filename": "thecut-durationfield-1.0.6.tar.gz", "has_sig": false, "md5_digest": "f316c118638ced2e23ca50745169f442", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11396, "upload_time": "2014-07-28T07:39:20", "url": "https://files.pythonhosted.org/packages/10/0a/0aba0aee8372d0e34cd5bb48fff4bb53e4f65f25e8302bce264fd22f577e/thecut-durationfield-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "a05b4d1130e5a5c069502a4ca4f38706", "sha256": "afcbcc09da5ea6cd6ec0f1797834a99619b2ef164ec724d8559e6cf45c5499b1" }, "downloads": -1, "filename": "thecut_durationfield-1.0.7-py2-none-any.whl", "has_sig": false, "md5_digest": "a05b4d1130e5a5c069502a4ca4f38706", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 12172, "upload_time": "2015-03-17T02:13:10", "url": "https://files.pythonhosted.org/packages/24/3f/66f422c9aac62ab0365595da1e8d8c32dbefe1f294b315d7a33bc643e7e5/thecut_durationfield-1.0.7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f2205920f916d04adfb57fefc1c05df", "sha256": "8e341ac58ec63bb0aa47915edd3885438880a7f9b1c3c6163aa11809508880ca" }, "downloads": -1, "filename": "thecut-durationfield-1.0.7.tar.gz", "has_sig": false, "md5_digest": "0f2205920f916d04adfb57fefc1c05df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11374, "upload_time": "2015-03-17T02:13:06", "url": "https://files.pythonhosted.org/packages/3c/bb/9012efe629a09e9548460779dd64d409a4b4b36f0e7023705c87992c861f/thecut-durationfield-1.0.7.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "98c1597a0817ba3d3e311ae7ea9400e3", "sha256": "6151eb022741072e97b1553133f3a5d097afb8462d5261ba6ed507d054632451" }, "downloads": -1, "filename": "thecut-durationfield-2.0.2.tar.gz", "has_sig": false, "md5_digest": "98c1597a0817ba3d3e311ae7ea9400e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14726, "upload_time": "2016-08-15T02:02:32", "url": "https://files.pythonhosted.org/packages/80/62/93c2fa1446cb8da0433ebb80d417ced14dd5d9b59e2a0a9f79ddece89d34/thecut-durationfield-2.0.2.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "0cb46c3325667e4215b73578d92c7175", "sha256": "7b66900759b8d055e36d62a4b717399fe8d2b57fad6e37ca6de45503ccc92d96" }, "downloads": -1, "filename": "thecut-durationfield-2.0.3.tar.gz", "has_sig": false, "md5_digest": "0cb46c3325667e4215b73578d92c7175", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14944, "upload_time": "2016-08-15T02:26:41", "url": "https://files.pythonhosted.org/packages/14/41/78487f8761819ccc03a5e09c9c0e0c5e9d2ab8b642ff0adac581be53cb09/thecut-durationfield-2.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0cb46c3325667e4215b73578d92c7175", "sha256": "7b66900759b8d055e36d62a4b717399fe8d2b57fad6e37ca6de45503ccc92d96" }, "downloads": -1, "filename": "thecut-durationfield-2.0.3.tar.gz", "has_sig": false, "md5_digest": "0cb46c3325667e4215b73578d92c7175", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14944, "upload_time": "2016-08-15T02:26:41", "url": "https://files.pythonhosted.org/packages/14/41/78487f8761819ccc03a5e09c9c0e0c5e9d2ab8b642ff0adac581be53cb09/thecut-durationfield-2.0.3.tar.gz" } ] }