Hallo all,

a couple of months ago I ordered my copy of the turbogears book but it
seems to have got lost in the mail, and the re-sent copy still hasn't
arrived, which means I've decided to bother you with my problems :-)

I've quickstarted my new app on Turbogears 1.0.3.2  and decided to set
up a mysql database schema by editing model.py as follows (I've tried
to simplify things as much as possible):

# my database schema

class Days(SQLObject):
    date = DateCol()
    shipments  = RelatedJoin('Shipments')
     < more stuff >

class Drivers(SQLObject):
    driverName = StringCol(length=5)
    < more stuff >

class Shipments(SQLObject):
    customerName = StringCol(length=5)
    days = RelatedJoin('Days')
    < more stuff >

Days.createTable(ifNotExists=True)
Drivers.createTable(ifNotExists=True)
Shipments.createTable(ifNotExists=True)

The idea being that on January 10th, 2008 for example I have to ship
goods to customer 'A', 'B' and 'C', and each of these customers must
also receive shipments on several different dates. The database schema
created for the many to many relationship between days and shipments
seems to me to be ok.

However,  my aim is also to create a table in which for each shipment
programmed for a specific date I would have a column with the name of
the Driver like this:

Date_id      Customer_id      Driver

which would be the best way of modifying the above classes to obtain
this? By using ForeingKey perhaps? Adding a relatedjoin doesn't seem
to do what I want.

Thanks for any tips.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to