django-public-holidays / README.rst

Full commit

A django app that contains tools and models for working with Public Holidays.


* add `public_holidays` to your ``settings.INSTALLED_APPS``
* update the database tables for `public_holidays`:

  ``$ python syncdb``
  ``$ syncdb``

* A new item will be created in your admin, which allows you to view
  and update public holidays.


A PublicHoliday object has a name, a date and a country. All of these are
required, which does mean for something like Christmas Day, you may have
many holidays on the same day, but this seemed like the best way to handle

A PublicHoliday may also have a list of provinces/states/districts (the
name will depend upon the country selected), which are where the holiday
is in effect.  If no values exist in this list, that means the holiday
applies to the whole country.  The list of possible provinces is gleaned
from django.contrib.localflavor, but if the country is not found in that
app, you can enter your own values. This should be a python/json list of

This app was written to allow one of my projects to determine if a given
date was a public holiday for wage purposes. The employer/workplace also
has an attribute which is a province, and this is used to see if a holiday
in a certain country is active for this workplace.

You should have the following installed:

* Django_
* my fork of `django-countries`_ - allows access to provinces from ``django.localflavor``
* `django-jsonfield`_ - to enable the storage of provinces as JSON serialized objects

Basically, your pip REQUIREMENTS.txt file should contain lines similar to::

  -e hg+
  -e hg+
  -e hg+

.. _Django:
.. _django-countries:
.. _django-jsonfield: