{ "info": { "author": "Peter Bex", "author_email": "peter@codeyellow.nl", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "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 :: Database", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "django-relativedelta\n====================\n\n.. image:: https://travis-ci.org/CodeYellowBV/django-relativedelta.svg?branch=master\n :target: https://travis-ci.org/CodeYellowBV/django-relativedelta\n\nA Django field for the `dateutil.relativedelta.relativedelta `_ class,\nwhich conveniently maps to the `PostgresQL INTERVAL type `_.\n\nThe standard `Django DurationField `_\nmaps to `Python's datetime.timedelta `_, which\nhas support for days and weeks, but not for years and months. And if you try to read an ``INTERVAL`` that contains\nmonths anyway, information is lost because each month gets converted to 30 days.\n\nYou should use this package when you need to store payment intervals\n(which tend to be monthly or quarterly), publication intervals (which\ncan be weekly but also monthly) and so on, or when you simply don't\nknow what the intervals are going to be and want to offer some\nflexibility.\n\nIf you want to use more advanced recurring dates, you should consider\nusing `django-recurrence `_\ninstead. This maps to the `dateutil.rrule.rrule `_\nclass, but it doesn't use native database field types, so you can't\nperform arithmetic on them within the database.\n\nUsage\n-----\n\nUsing the field is straightforward. You can add the field to your\nmodel like so:\n\n.. code:: python\n\n from django.db import models\n from relativedeltafield import RelativeDeltaField\n\n class MyModel(models.Model):\n rdfield=RelativeDeltaField()\n\nThen later, you can use it:\n\n.. code:: python\n\n from dateutil.relativedelta import relativedelta\n\n rd = relativedelta(months=2,days=1,hours=6)\n my_model = MyModel(rdfield=rd)\n my_model.save()\n\n\nOr, alternatively, you can use a string with the\n`ISO8601 \"format with designators\" time interval syntax `_:\n\n.. code:: python\n\n from dateutil.relativedelta import relativedelta\n\n my_model = MyModel(rdfield='P2M1DT6H')\n my_model.save()\n\n\nFor convenience, a standard Python ``datetime.timedelta`` object is\nalso accepted:\n\n.. code:: python\n\n from datetime import timedelta\n\n td = timedelta(days=62,hours=6)\n my_model = MyModel(rdfield=td)\n my_model.save()\n\nAfter a ``full_clean()``, the object will always be converted to a\n_normalized_ ``relativedelta`` instance. It is highly recommended\nyou use the `django-fullclean `_\napp to always force ``full_clean()`` on ``save()``, so you can be\nsure that after a ``save()``, your fields are both normalized\nand validated.\n\n\nLimitations and pitfalls\n------------------------\n\nBecause this field is backed by an ``INTERVAL`` column, it neither\nsupports the relative ``weekday``, ``leapdays``, ``yearday`` and\n``nlyearday`` arguments, nor the absolute arguments ``year``,\n``month``, ``day``, ``hour``, ``second`` and ``microsecond``.\n\nThe ``microseconds`` field is converted to a fractional ``seconds``\nvalue, which might lead to some precision loss due to floating-point\nrepresentation.\n\nThe ``weeks`` field is \"virtual\", being derived from the multiple of 7\ndays. Thus, any week value in the input interval specification is\nconverted to days and added to the ``days`` field of the interval.\nWhen serializing back to a string, weeks will never be written.\nSimilarly, if the interval contains a multiple of 7 days, you can read\nthis back out from the ``weeks`` property.\n\nDatabases other than PostgreSQL are not supported.\n\nFor consistency reasons, when a relativedelta object is assigned to a\nRelativeDeltaField, it automatically calls ``normalized()`` on\n``full_clean``. This ensures that the database representation is as\nsimilar to the relativedelta as possible (for instance, fractional\ndays are always converted to hours).\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/CodeYellowBV/django-relativedelta", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-relativedelta", "package_url": "https://pypi.org/project/django-relativedelta/", "platform": "", "project_url": "https://pypi.org/project/django-relativedelta/", "project_urls": { "Homepage": "https://github.com/CodeYellowBV/django-relativedelta" }, "release_url": "https://pypi.org/project/django-relativedelta/1.0.5/", "requires_dist": [ "Django (>=1.10)", "python-dateutil (>=2.6.0)" ], "requires_python": "", "summary": "Django alternative to DurationField using dateutil.relativedelta", "version": "1.0.5" }, "last_serial": 5117847, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4583caf38c73ab670be23ccad6230dc1", "sha256": "d8b369ebd27fb8de9d307052d03d71120483de1681f7511e4746844d12a25751" }, "downloads": -1, "filename": "django_relativedelta-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4583caf38c73ab670be23ccad6230dc1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9899, "upload_time": "2017-06-09T12:22:32", "url": "https://files.pythonhosted.org/packages/7c/1f/51b20e491743587661415044f49c8f3c864fae79d17910e7d0841aec6ece/django_relativedelta-1.0.0-py3-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "927842963e50436078cf9283c39d1df5", "sha256": "f66cd6d71ff4ffe0775c2ffd8b12d4a32aa8bb24b382ff96c67a8b067441d129" }, "downloads": -1, "filename": "django-relativedelta-1.0.1.tar.gz", "has_sig": false, "md5_digest": "927842963e50436078cf9283c39d1df5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6875, "upload_time": "2017-07-20T14:54:27", "url": "https://files.pythonhosted.org/packages/3d/aa/50518895f998e8ae221768fc9c9fce39943c10bc99a0099d80bddd7f0db1/django-relativedelta-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "82014cc8da1f0e5e1033358aca6a98f3", "sha256": "b3ff69397aeb90d263b555dda0f409061eee5fda8e724c2dfa3ec3ed28fd09f5" }, "downloads": -1, "filename": "django-relativedelta-1.0.2.tar.gz", "has_sig": false, "md5_digest": "82014cc8da1f0e5e1033358aca6a98f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7192, "upload_time": "2017-09-19T06:58:25", "url": "https://files.pythonhosted.org/packages/49/d8/1ace0a86424dd8ca19a2421cb5a7461587f6102985d86538678c764bca82/django-relativedelta-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "80cbfae3f943cf67e9b7c02c2a9e7cd4", "sha256": "deddc795898a5dc8d006a6bc71c9af0d5ead234a108f6d9ef2a6ea1c2642214a" }, "downloads": -1, "filename": "django-relativedelta-1.0.3.tar.gz", "has_sig": false, "md5_digest": "80cbfae3f943cf67e9b7c02c2a9e7cd4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7195, "upload_time": "2017-09-19T06:57:05", "url": "https://files.pythonhosted.org/packages/5c/7f/6e3f5ea2cdd22112579b20735256f548be8e905971e3731063d78313a87f/django-relativedelta-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "45357750570a8ccd31e7dbf26ea13839", "sha256": "cf4822f0f1ef9a3f5f59421808646aa572fa67d68e00a0bafa09bc92ffff8953" }, "downloads": -1, "filename": "django-relativedelta-1.0.4.tar.gz", "has_sig": false, "md5_digest": "45357750570a8ccd31e7dbf26ea13839", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7213, "upload_time": "2018-08-03T10:44:03", "url": "https://files.pythonhosted.org/packages/64/7a/96ff4dbacbcedd4a49224ea22180823e41214f560aa26047d8d5b989445d/django-relativedelta-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "f628c8a245f80ecf47d614e22d0df725", "sha256": "dad50886f8389a9d92fae9e195a6212271b438b171285abc0a1215b0113fc7fa" }, "downloads": -1, "filename": "django_relativedelta-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "f628c8a245f80ecf47d614e22d0df725", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8765, "upload_time": "2019-03-11T14:43:13", "url": "https://files.pythonhosted.org/packages/c7/b3/4c8449c23b47028f228a8b0189feb9bc0b4b76a716eb34b783575e71ce88/django_relativedelta-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e25da6d63a2fe57e4e393d1c2744346d", "sha256": "9d9f4fc34cf029f5645760d2366e8dc5529f5b70270d2f58ae4d5fca3b549fb2" }, "downloads": -1, "filename": "django-relativedelta-1.0.5.tar.gz", "has_sig": false, "md5_digest": "e25da6d63a2fe57e4e393d1c2744346d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7335, "upload_time": "2019-03-11T14:43:14", "url": "https://files.pythonhosted.org/packages/44/0c/5524fa3c2761dff70fd2d2c65063506d306d8284f03b625477efe03c17c6/django-relativedelta-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f628c8a245f80ecf47d614e22d0df725", "sha256": "dad50886f8389a9d92fae9e195a6212271b438b171285abc0a1215b0113fc7fa" }, "downloads": -1, "filename": "django_relativedelta-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "f628c8a245f80ecf47d614e22d0df725", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8765, "upload_time": "2019-03-11T14:43:13", "url": "https://files.pythonhosted.org/packages/c7/b3/4c8449c23b47028f228a8b0189feb9bc0b4b76a716eb34b783575e71ce88/django_relativedelta-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e25da6d63a2fe57e4e393d1c2744346d", "sha256": "9d9f4fc34cf029f5645760d2366e8dc5529f5b70270d2f58ae4d5fca3b549fb2" }, "downloads": -1, "filename": "django-relativedelta-1.0.5.tar.gz", "has_sig": false, "md5_digest": "e25da6d63a2fe57e4e393d1c2744346d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7335, "upload_time": "2019-03-11T14:43:14", "url": "https://files.pythonhosted.org/packages/44/0c/5524fa3c2761dff70fd2d2c65063506d306d8284f03b625477efe03c17c6/django-relativedelta-1.0.5.tar.gz" } ] }