Hello,
I am attempting to create tables for an application I am writing to help my
wife track her home business. I want a a table to hold some client
information (Client), with multiple joins to a table holding phones, emails,
and addresses (allowing multiple associations for each back to the client).
Here are the classes out of model.py (some field removed for clarity)
class Client(SQLObject):
title = StringCol(length=5)
f_name = StringCol(length=15)
m_name = StringCol(length=15)
l_name = StringCol(length=20)
s_name = StringCol(length=5)
dob = DateCol()
gender = StringCol(length=1)
phones = MultipleJoin('Phone')
emails = MultipleJoin('Email')
addresses = MultipleJoin('Address')
class Phone(SQLObject):
type = StringCol(length=1)
value = StringCol(length=15)
client = RelatedJoin('Client')
class Email(SQLObject):
type = StringCol(length=1)
value = StringCol(length=100)
client = RelatedJoin('Client')
class Address(SQLObject):
type = StringCol(length=1)
line1 = StringCol(length=50)
line2 = StringCol(length=50)
city = StringCol(length=50)
state = StringCol(length=2)
postal= StringCol(length=10)
client = RelatedJoin('Client')
When I run tg-admin sql create I get the address, client, email, and phone
tables, as well as a address_client table. I am expecting an email_client
and phone_client but I don't see them. Am I correct to assume I should get
a join tables for the other two? And, if so, am I doing something wrong in
my class definitions? I've looked at this for a couple days now and just
don't see it.
Related to this, since I am just learning this, should I make the effort to
use SQLAlchemy in place of SQLObject?
I'm running on a Windows XP (home) box using postgres.
Thanks for your time and attention,
--greg
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---