Re: [sqlalchemy] Multiple tables and foreignkey constraints

2014-07-23 Thread Jonathan Vanasco
I would probably do: # Keep track of manufacturer names t_manufacturer = Table(u'manufacturer', metadata, Column(u'id', Integer, primary_key=True, Column(u'name', String(20)) ) # Keep track of model names t_model = Table(u'model', metadata, Column(u'id', Integer, primary_key=True, Column(u'manufa

Re: [sqlalchemy] Multiple tables and foreignkey constraints

2014-07-22 Thread Ken Roberts
If I'm understanding correctly, something like the following: # Keep track of manufacturer names manufacturers_table = Table(u'manufacturer', metadata, Column(u'id', Integer, primary_key=True, Column(u'name', String(20)) ) # Keep track of model names models_table = Table(u'model', metadat

Re: [sqlalchemy] Multiple tables and foreignkey constraints

2014-07-21 Thread Ken Roberts
Forgot to mention that during typical operation, the only time the database will be accessed would be during down time (add/delete) or program startup (retrieve list of projectors to control) - not during a presentation. -- You received this message because you are subscribed to the Google Grou

Re: [sqlalchemy] Multiple tables and foreignkey constraints

2014-07-21 Thread Ken Roberts
On Monday, July 21, 2014 8:38:54 AM UTC-7, Jonathan Vanasco wrote: > > I agree with what Mike said, but I would just suggest renaming > "projector_table" to something like "purchased_table" or "inventory_table". > Everything in "models" is a different model of a projector, so the table > name

Re: [sqlalchemy] Multiple tables and foreignkey constraints

2014-07-21 Thread Jonathan Vanasco
I agree with what Mike said, but I would just suggest renaming "projector_table" to something like "purchased_table" or "inventory_table". Everything in "models" is a different model of a projector, so the table names are a bit confusing. In non-database terms, a good way to visualize relatio

Re: [sqlalchemy] Multiple tables and foreignkey constraints

2014-07-19 Thread Michael Bayer
On Jul 18, 2014, at 6:08 PM, Ken Roberts wrote: > I'm having fun trying to visualize this in my head, but I have 4 tables, 3 > are basic relations, but the 4th table links to table 2. > > Should I take the 4th table and have a relation join with all 3 tables or can > I just relate to table 2