I'm a beginner, but I would do like this:
class Reservation(models.Model):
properties=model.CharField(maxlength=7,primary_key=True)
class Restaurant(models.Model):
name=models.CharField(maxlength=30,primary_key=True)
reservations=models.ForeignKey(Reservation)
class Theater(models.Model):
name=models.CharField(maxlength=30,primary_key=True)
reservations=models.ForeignKey(Reservation)
class Hotel(models.Model):
name=models.CharField(maxlength=30,primary_key=True)
reservations=models.ForeignKey(Reservation)
Use ForeignKey or ManyToMany as you need.
Enjoy,
G
On 6/2/06, Cornel Nitu <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> My application have three main models: Restaurant, Hotel, Theather. The
> fourth model is Reservation. I don't figure out to link the Reservation
> with the others, because everyone needs a reservation. :)
>
> PS. I don't want to duplicate the attributes/methods from the
> Reservation.
>
> Thanks
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---