{ "info": { "author": "Greg Brown", "author_email": "greg@gregbrown.co.nz", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "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 :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "django-eventtools is a lightweight library designed to handle repeating\nand one-off event occurrences for display on a website.\n\n|Circle CI| |codecov| |Latest Version|\n\nInstallation\n------------\n\nDownload the source from https://pypi.python.org/pypi/django-eventtools/\nand run ``python setup.py install``, or:\n\n::\n\n > pip install django-eventtools\n\nDjango 1.8 or higher is required.\n\nSetup\n-----\n\nGiven the following models:\n\n::\n\n from django.db import models\n\n from eventtools.models import BaseEvent, BaseOccurrence\n\n\n class MyEvent(BaseEvent):\n title = models.CharField(max_length=100)\n\n\n class MyOccurrence(BaseOccurrence):\n event = models.ForeignKey(MyEvent)\n\nUsage\n-----\n\nCreate a sample event & occurrences\n\n::\n\n >>> from datetime import datetime\n >>> from myapp.models import MyEvent\n >>> event = MyEvent.objects.create(title='Test event')\n >>> once_off = MyOccurrence.objects.create(\n event=event,\n start=datetime(2016, 1, 1, 12, 0),\n end=datetime(2016, 1, 1, 2, 0))\n >>> christmas = MyOccurrence.objects.create(\n event=event,\n start=datetime(2015, 12, 25, 7, 0),\n end=datetime(2015, 12, 25, 22, 0),\n repeat='RRULE:FREQ=YEARLY')\n >>> daily = MyOccurrence.objects.create(\n event=event,\n start=datetime(2016, 1, 1, 7, 0),\n end=datetime(2016, 1, 1, 8, 0),\n repeat='RRULE:FREQ=DAILY')\n\nEvent and Occurrence instances, and their associated querysets, all\nsupport the ``all_occurrences`` method, which takes two optional\narguments - ``from_date`` and ``to_date``, which may be dates or\ndatetimes. ``from_date`` and ``to_date`` default to ``None``. The method\nreturns a python generator yielding tuples in the format\n``(start, end, instance)`` - for example:\n\n::\n\n >>> MyEvent.objects.all().all_occurrences()\n >>> event.all_occurrences(from_date=datetime(2015, 1, 1, 10, 0))\n >>> event.occurrence_set.all().all_occurrences(to_date=date(2016, 1, 1))\n >>> occurrence.all_occurrences(from_date=date(2016, 1, 1),\n to_date=date(2016, 12, 31))\n\n``instance`` is an instance of the corresponding BaseOccurrence\nsubclass.\n\nA ``next_occurrence`` method is also provided, taking the same\narguments, but returning a single occurrence tuple.\n\n::\n\n >>> event.next_occurrence()\n >>> event.next_occurrence(from_date=date(2016, 1, 1))\n\nThe method ``first_occurrence`` also returns a single occurrence tuple,\nbut takes no arguments.\n\nQueryset filtering\n~~~~~~~~~~~~~~~~~~\n\nEvent and Occurrence querysets can be filtered, but due to uncertainty\nwith repetitions, ``from_date`` filtering is only an approximation\n(whereas ``to_date`` filtering is accurate). If you need a queryset\nfiltered exactly, pass ``exact=True`` - this will filter using generated\noccurrences but still return a queryset - but be careful with this as it\nmay be very slow and/or CPU-hungry. For example\n\n::\n\n >>> MyEvent.objects.for_period(from_date=date(2015, 1, 1),\n to_date=date(2015, 12, 31))\n >>> event.occurrence_set.for_period(from_date=date(2015, 1, 1), exact=True)\n\nSorting querysets\n~~~~~~~~~~~~~~~~~\n\nEvent and Occurrence querysets can also be sorted by their next\noccurrence using the ``sort_by_next`` method. By default this sorts\ninstances by their first occurrence; the optional ``from_date`` argument\nwill sort by the next occurrence after ``from_date``. For example\n\n::\n\n >>> MyEvent.objects.all().sort_by_next()\n >>> event.occurrence_set.for_period(from_date=date(2015, 1, 1)) \\\n >>> .sort_by_next(date(2015, 1, 1))\n\nNote that this method returns a sorted list, not a queryset.\n\nCustom repeat intervals\n-----------------------\n\nOccurrences can repeat using any interval that can be expressed as an\n`rrulestr `__.\nTo customise the available options, set ``EVENTTOOLS_REPEAT_CHOICES`` in\nyour django settings. The default value is\n\n::\n\n EVENTTOOLS_REPEAT_CHOICES = (\n (\"RRULE:FREQ=DAILY\", 'Daily'),\n (\"RRULE:FREQ=WEEKLY\", 'Weekly'),\n (\"RRULE:FREQ=MONTHLY\", 'Monthly'),\n (\"RRULE:FREQ=YEARLY\", 'Yearly'),\n )\n\nSet ``EVENTTOOLS_REPEAT_CHOICES = None`` to make repeat a plain-text\nfield.\n\nRunning tests\n-------------\n\nUse tox (https://pypi.python.org/pypi/tox):\n\n::\n\n > pip install tox\n > cd path-to/django-eventtools\n > tox\n\n.. |Circle CI| image:: https://circleci.com/gh/gregplaysguitar/django-eventtools.svg?style=svg\n :target: https://circleci.com/gh/gregplaysguitar/django-eventtools\n.. |codecov| image:: https://codecov.io/gh/gregplaysguitar/django-eventtools/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/gregplaysguitar/django-eventtools\n.. |Latest Version| image:: https://img.shields.io/pypi/v/django-eventtools.svg?style=flat\n :target: https://pypi.python.org/pypi/django-eventtools/\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gregplaysguitar/django-eventtools", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "django-eventtools", "package_url": "https://pypi.org/project/django-eventtools/", "platform": "any", "project_url": "https://pypi.org/project/django-eventtools/", "project_urls": { "Homepage": "https://github.com/gregplaysguitar/django-eventtools" }, "release_url": "https://pypi.org/project/django-eventtools/0.9.11/", "requires_dist": null, "requires_python": "", "summary": "Recurring event tools for django", "version": "0.9.11" }, "last_serial": 2671822, "releases": { "0.9.1": [ { "comment_text": "", "digests": { "md5": "fced4ff4a9927c6e9cc4a521afde43bd", "sha256": "7aefec41f7b70efbb33929842ed0843c2fddea4fcc5d64212670fef1989f7433" }, "downloads": -1, "filename": "django-eventtools-0.9.1.tar.gz", "has_sig": false, "md5_digest": "fced4ff4a9927c6e9cc4a521afde43bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7682, "upload_time": "2015-08-20T03:51:29", "url": "https://files.pythonhosted.org/packages/91/68/88d5d8e1d806218a4b6640f543183ff8082f5d57ea45ce1b198be4c8ad66/django-eventtools-0.9.1.tar.gz" } ], "0.9.10": [ { "comment_text": "", "digests": { "md5": "b2e62df6c023d624cf17b85429f231be", "sha256": "55f7aca58886765e9c6fae1c7cce9f32db4cb25b5a01333c200e8bc9feb85eed" }, "downloads": -1, "filename": "django-eventtools-0.9.10.tar.gz", "has_sig": false, "md5_digest": "b2e62df6c023d624cf17b85429f231be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10935, "upload_time": "2016-10-17T03:18:34", "url": "https://files.pythonhosted.org/packages/b5/e8/770228327bd166cfb7001a431704cae5016337cb709b60d5337361509ae6/django-eventtools-0.9.10.tar.gz" } ], "0.9.11": [ { "comment_text": "", "digests": { "md5": "71b2a048dd8ae9fda4bd1be5e74fbac5", "sha256": "655997ef9c5f569ee83ba568247c9ad61d433bb37a344caaa1c307acae203281" }, "downloads": -1, "filename": "django-eventtools-0.9.11.tar.gz", "has_sig": false, "md5_digest": "71b2a048dd8ae9fda4bd1be5e74fbac5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12090, "upload_time": "2017-02-27T21:42:15", "url": "https://files.pythonhosted.org/packages/8f/9e/612a150b89bf2eaee8b9b7098b7a01bc36b8ee4919e3c4e623d10f207530/django-eventtools-0.9.11.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "7b04bed69440140d6c7bae9c53fe1def", "sha256": "d73e6eaf5934d0bda223bb31d06c21ac560bcd67d96197956e882f87489cc4d7" }, "downloads": -1, "filename": "django-eventtools-0.9.2.tar.gz", "has_sig": false, "md5_digest": "7b04bed69440140d6c7bae9c53fe1def", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8387, "upload_time": "2015-11-18T22:34:10", "url": "https://files.pythonhosted.org/packages/b2/3f/d826b7fe8ac3ce9d7b27b0037b6398c4110011ca727c697be47aab96a4e2/django-eventtools-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "012febb90386332ae66ab163bc2de7c0", "sha256": "11692451d64299a9d46a581731e87787db04ba478ce704bada81b046457fe4d5" }, "downloads": -1, "filename": "django-eventtools-0.9.3.tar.gz", "has_sig": false, "md5_digest": "012febb90386332ae66ab163bc2de7c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9351, "upload_time": "2016-01-26T08:41:37", "url": "https://files.pythonhosted.org/packages/ca/be/d09a8ca3c98eb88282631140c600f145710470ee47cd49cf81883bff5c4b/django-eventtools-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "8dd134e6aeb8cf474e944a831167bdf2", "sha256": "a8439f2c5de45d790ebcbca074506632b14bf70496df38911c8d8871b850104d" }, "downloads": -1, "filename": "django-eventtools-0.9.4.tar.gz", "has_sig": false, "md5_digest": "8dd134e6aeb8cf474e944a831167bdf2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9463, "upload_time": "2016-02-03T23:08:47", "url": "https://files.pythonhosted.org/packages/7d/73/9325bdcc803c513b65aaabcfe042ae9054bcdf8152afa5574a070208a278/django-eventtools-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "580cd3c81a1b1214533ce10241db722d", "sha256": "e5d149f04894e09c277c741e3c4d331948e28fd9152626ef7a7da74b6bfa80c9" }, "downloads": -1, "filename": "django-eventtools-0.9.5.tar.gz", "has_sig": false, "md5_digest": "580cd3c81a1b1214533ce10241db722d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10021, "upload_time": "2016-03-21T23:02:34", "url": "https://files.pythonhosted.org/packages/05/17/294ad70351c25eea14c9a4ef2d1bb741a4bf94bd3180911a41b08da10e90/django-eventtools-0.9.5.tar.gz" } ], "0.9.6": [ { "comment_text": "", "digests": { "md5": "32ccac2d03b6e3bba11d8244b37de139", "sha256": "142bb37e1850c7646ca9a10134ffd9922efb217d1371bc2617c234df56514aac" }, "downloads": -1, "filename": "django-eventtools-0.9.6.tar.gz", "has_sig": false, "md5_digest": "32ccac2d03b6e3bba11d8244b37de139", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8447, "upload_time": "2016-03-30T01:30:31", "url": "https://files.pythonhosted.org/packages/72/87/2ee02001092a7ffd0662350ab046abefce68928be7f5169983a3836e5d4e/django-eventtools-0.9.6.tar.gz" } ], "0.9.7": [ { "comment_text": "", "digests": { "md5": "43e7b7a86c7d265987322862457f59c4", "sha256": "1a12da795ada2dcdde77bfde0ad3ceeb4ad01b0246621e8cd88f5f5e2cad10ac" }, "downloads": -1, "filename": "django-eventtools-0.9.7.tar.gz", "has_sig": false, "md5_digest": "43e7b7a86c7d265987322862457f59c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10096, "upload_time": "2016-04-01T01:04:30", "url": "https://files.pythonhosted.org/packages/50/78/f3c464d468120914bf083900b46cc53a7478dbba2274f3fca047d83749d3/django-eventtools-0.9.7.tar.gz" } ], "0.9.8": [ { "comment_text": "", "digests": { "md5": "9543ea59ffc3181d79a0c5fada5db470", "sha256": "01c22e975b2bef2bfc6e6e688ae7bbc04c9ea146128fcc34e2dce85749a519d2" }, "downloads": -1, "filename": "django-eventtools-0.9.8.tar.gz", "has_sig": false, "md5_digest": "9543ea59ffc3181d79a0c5fada5db470", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10396, "upload_time": "2016-07-29T03:24:26", "url": "https://files.pythonhosted.org/packages/c7/9d/f3040957c71135bf5ea29bf626f69621643d107866fa601601b9f9126ad6/django-eventtools-0.9.8.tar.gz" } ], "0.9.9": [ { "comment_text": "", "digests": { "md5": "7538b05048c2c896d0d412fbc0e0695b", "sha256": "56ba0b2e84cd52418c93f18283d1111c309a6d4f6870ec5fa02ae6fb3bdcc092" }, "downloads": -1, "filename": "django-eventtools-0.9.9.tar.gz", "has_sig": false, "md5_digest": "7538b05048c2c896d0d412fbc0e0695b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10744, "upload_time": "2016-09-20T21:40:48", "url": "https://files.pythonhosted.org/packages/64/9b/3a669d9697da3d9fbc25be4a949f3b895445aaf8edda24f7e9e044f621dc/django-eventtools-0.9.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "71b2a048dd8ae9fda4bd1be5e74fbac5", "sha256": "655997ef9c5f569ee83ba568247c9ad61d433bb37a344caaa1c307acae203281" }, "downloads": -1, "filename": "django-eventtools-0.9.11.tar.gz", "has_sig": false, "md5_digest": "71b2a048dd8ae9fda4bd1be5e74fbac5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12090, "upload_time": "2017-02-27T21:42:15", "url": "https://files.pythonhosted.org/packages/8f/9e/612a150b89bf2eaee8b9b7098b7a01bc36b8ee4919e3c4e623d10f207530/django-eventtools-0.9.11.tar.gz" } ] }