• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    Python
  • License
    Other
  • Created over 12 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Django module for handling reservations/booking

django-reservations

A simple and customizable Django module for handling reservations.

Sample app screenshot using django-reservations

Features

  • Customizable reservations (you can provide your own reservation model)
  • Configurable (single/multiple reservations per day, default free spots, reservations per month)
  • Automatic customizable emails with reservation details
  • Custom Django Admin backend
  • Ajax calendar for reservation creation and handling
  • UI based on Twitter Bootstrap
  • Using i18n to handle translations

Usage

You can use django-reseravations as any other django module. You have to add it to your Python PATH. After this add 'reservations' to your INSTALLED_APPS in settings.py. Also you need to set RESERVATION_SPOTS_TOTAL setting so app knows what is the reservations number limit per day. Add it to your urls.py:

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

After these basic steps you are ready to go. Just run manage.py syncdb to create suitable database models. The reservation app will be available under the URL /reservations/calendar. Visit it to see how it works and how it looks like ;)

Customization

You can also set some other settings to customize it further:

RESERVATIONS_PER_MONTH (unlimited by default) - how many reservations can a single user create during one month RESERVATIONS_PER_DAY (unlimited by default) - how many reservations can a single user create on one day (for example user should not be able to make more than one reservation per day)

If you would like to add some extra data for each reservation (gender, nationality, whatever..) you can inherit Reservation model and extend it with you custom fields. After that the model will automatically use you new model (and it will update the UI too!). All the Django validation will work too (via ajax!).

The simplest way is to create a new app inside your project (myreservations for example) and add it to your INSTALLED_APPS. In your new app create models.py in which you will inherit from Reservation model. After creating your custom model you need to call update_model so Resevations module knows about your new model.

from django.db import models
from reservations import update_model
from reservations.models import Reservation

RACE = (
        ('alien', 'Killing Machine'),
        ('android', 'Artificial Inteligence'),
        ('human', 'Ordinary Guy'),
    )

class DetailedReservation(Reservation):
    """Your extra data for the basic model"""
    shoe_number = models.IntegerField()
    race = models.CharField(max_length=32, choices=RACE)

    def short_desc(self):
        """Displayed on the reservation removal button"""
        return str(self.id) + "/" + str(self.race)

update_model(DetailedReservation)

Customizing emails that are sent when reservation is being made can be easily done by creating email_new.html template file. Data available in the template is described below. You can check email_new.html template in reservations module for reference.

{'name': username_of_the_user_that_made_a_reservation,
'date': date_of_the_reservation,
'reservation_id': reservation_id,
'extra_data': form_with_extra_data,
'domain': APP_URL_setting}

Testing

Project has full unit test coverage of the backend. After adding it to your Django project you can run tests from your shell.

./manage.py test reservations

Continuous Integration status

TODOs

  • Sample app using Django reservations
  • Implemenging user requested features

Got some questions or suggestions? Mail me directly or use the issue tracker.

More Repositories

1

gauge.js

100% native and cool looking JavaScript gauge
JavaScript
1,417
star
2

querystring-parser

QueryString parser for Python/Django that correctly handles nested dictionaries
Python
138
star
3

IrisRecognition

Old iris recognition software I made with my friend. It uses Hough and Gabor transforms to make things happen.
89
star
4

tornado-acl

Access Control List for Tornado (or just plain Python)
Python
29
star
5

embedded-graphics-framebuf

Generic framebuffer implementation in Rust for use with embedded-graphics library
Rust
26
star
6

android-django-aes

Code snippets for communication between Android(Java) device and Django(python) with AES ecrypted data
Java
20
star
7

python-media-crawler

Simple Python web crawler that looks through websites for media files (mp3, wma, aac.) and extracts their metadata
Python
19
star
8

BarcodePrinter

A simple, configurable barcode (CODE-128) PDF printer/generator
Python
11
star
9

sataddress-rs

Federated Lightning Network addresses server.
Rust
9
star
10

NeuralNetwokPerceptronKohonen

Implementation of neural networks in Java: Kohonen and Perceptron with backpropagation algorithm
Java
8
star
11

yummy-pasta

Pasta is so yummy
JavaScript
5
star
12

PyQRNativeGAE

Native python QR Code generator for Google App Engine
Python
5
star
13

embedded-graphics-sparklines

Lightweight graphs (sparklines) for use with Embedded Rust
Rust
5
star
14

OpenBciP300

Open Brain Computer Interface project using P300 paradigm
Java
5
star
15

python-num-variations-pl

Plural forms of polish words in python for Django
Python
2
star
16

BrainboyMobile

A simple app to improve your brain abilities. Inspired by BrainBoy hardware device.
Java
1
star
17

django-registration-links

A simple Django module for invite-only registration with unique access links
Python
1
star
18

python-101

Some things that are done 'pythonic' way
Python
1
star
19

select-variants.js

Variant Selector Widget
CoffeeScript
1
star