I had a similar problem to this and solved it by renaming teh foreign key field.  So in your case you might try something like "Project.customer" instead of "Project.CustomerID".

SQLObject tries to do some magic in there when matching the id fields to objects, and sometimes you can confuse it.

There's also a way to specify the name of the ID column in your model, but I can't remember how off the top of my head.

Hope this helps at least a little...

Kevin H.

On 8/7/06, mrclean <[EMAIL PROTECTED]> wrote:

I apologize if this has been answered before, but I haven't been able
to find a suitable (any) solution and am hoping the TurboGears
community can help me out.

I have two tables: Projects and Customers.  Within the Projects table
there is an ID (foreign key) referencing the customer.  If I do a
select on the project, I only get the customer ID, not the customer
name (as one would expect).  What I am having trouble with is finding a
suitable way to get the actual name in the same select result as the
rest of the project info.

To put it another way, I'm looking for a series of SQLObject
interactions that would produce something similar to the following SQL:

SELECT Customer.name , Project.info FROM Project, Customer where
Customer.id = Project.CustomerID

Again, I apologize if this is answered somewhere else, but I couldn't
find anything.

Thank you

-David Marsh






--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to