Skip to main content

A reusable Django app that manages bookings for various purposes.

Project description

Django Booking
============

A reusable Django app that manages bookings for various purposes.

Installation
------------

To get the latest stable release from PyPi

.. code-block:: bash

$ pip install django-booking

To get the latest commit from GitHub

.. code-block:: bash

$ pip install -e git+git://github.com/bitmazk/django-booking.git#egg=booking

TODO: Describe further installation steps (edit / remove the examples below):

Add ``booking`` to your ``INSTALLED_APPS``

.. code-block:: python

INSTALLED_APPS = (
...,
'booking',
)

Add the ``booking`` URLs to your ``urls.py``

.. code-block:: python

urlpatterns = patterns('',
...
url(r'^booking/', include('booking.urls')),
)

Don't forget to migrate your database

.. code-block:: bash

./manage.py migrate booking


Usage
-----

If you allow anonymous bookings, the session object is stored within the
booking model. Otherwise it will be connected to the User model.

NOTE: If a session is destroyed, the connected booking model will also be
removed.

In order to allow login via email and booking ID, please add this to your
``AUTHENTICATION_BACKENDS``::

AUTHENTICATION_BACKENDS = (
# your usual auth backends
'booking.auth_backends.BookingIDBackend',
)

At the moment you will have to write a new view that will render the
``booking.forms.BookingIDAuthenticationForm``. If the form is valid, your
view should call ``auth_login(request, form.get_user())``, similar to Django's
original login view.

Settings
--------

BOOKING_STATUS_CREATED
++++++++++++++++++++++

Default: 'pending'

Slug of the ``BookingStatus``, which should be added after booking creation.

BOOKING_TIME_INTERVAL
+++++++++++++++++++++

Default: ''

The default value for the ``time_unit`` attribute of the Booking. Set it in
case you need to specify that you want to book something e.g. X days or Y
hours. Set it to the singular of that time unit:::

BOOKING_TIME_INTERVAL = 'day'

Contribute
----------

If you want to contribute to this project, please perform the following steps

.. code-block:: bash

# Fork this repository
# Clone your fork
$ mkvirtualenv -p python2.7 django-booking
$ python setup.py install
$ pip install -r dev_requirements.txt

$ git co -b feature_branch master
# Implement your feature and tests
$ git add . && git commit
$ git push -u origin feature_branch
# Send us a pull request for your feature branch

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-booking-0.3.tar.gz (14.9 kB view details)

Uploaded Source

File details

Details for the file django-booking-0.3.tar.gz.

File metadata

  • Download URL: django-booking-0.3.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-booking-0.3.tar.gz
Algorithm Hash digest
SHA256 0074d25336786605fda27e9f8017c81289ebd70c7df368fa4db63e1ef6820aae
MD5 657de7f5c3a267b8478e0b7a749fe7a7
BLAKE2b-256 d65244ab38ac1e02872a80628e45b485aaf76acf3ca784d68ea6959c59df0b82

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page