I'm trying to create an automated booking system for educational
events. Admin user creates workshops in the admin interface, then
creates a number of related accommodation options. Website visitor
signs up for workshops (ie, potentially more than one workshop) and can
also sign up for accommodation.
Given a models.py which looks like this (trimmed slightly for
conciseness):
class Workshop(models.Model):
code = models.CharField(maxlength=30)
title = models.CharField(maxlength=60)
description = models.TextField()
price = models.FloatField(max_digits=8,decimal_places=2)
date_start = models.DateTimeField()
date_end = models.DateTimeField()
visible = models.BooleanField()
contact = models.ManyToManyField(Employee)
class Accommodation(models.Model):
name = models.CharField(maxlength=40)
description = models.CharField(maxlength=40)
date_start = models.DateTimeField()
date_end = models.DateTimeField()
visible = models.BooleanField()
price = models.FloatField(max_digits=8,decimal_places=2)
workshop = models.ForeignKey(Workshop)
class Attendee(models.Model):
title = models.CharField(maxlength=20)
firstname = models.CharField(maxlength=30)
surname = models.CharField(maxlength=30)
job_title = models.CharField(maxlength=60,blank=True)
organisation = models.CharField(maxlength=60,blank=True)
address = models.TextField()
postcode = models.CharField(maxlength=16)
country = models.ForeignKey(Country)
telephone = models.CharField(maxlength=30)
email = models.EmailField()
class Workshop_Booking(models.Model):
attendee = models.ForeignKey(Attendee)
workshop = models.ManyToManyField(Workshop,
filter_interface=True)
accommodation = models.ManyToManyField(Accommodation,
filter_interface=True)
date_booked = models.DateTimeField()
Is there a (relatively) quick and easy way to create a form which would
allow a web user (not the admin user) to enter their details and select
workshops and accommodation options, preferably all on one screen? The
form might look like this:
Title: ......
Firstname: .......................
Lastname: .......................
etc.
x Workshop event 1
o Hotel
o Campsite
o Hostel
x Workshop 2
o Hotel
o Campsite
o Hostel
My thinking so far is to add a manipulator for the "Attendee" model,
then create the details of the events myself, and check selections for
correctness using a custom validator, or checking the POST variables
"by hand". Is there a better way?
TIA.
--
James M
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---