On 2/15/06, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> If I have a foreign key, using SQLObject alone I could do:
>
>     print object_with_resultset.some_foreign_key.field_in_other_table

That's not SQLObject doing that, that's Python. When you do
.some_foreign_key, a getter that SQLObject put on your class is
retrieving the object on the other side. ".field_in_other_table" is
just a standard attribute lookup at that point. All of that
interpretation is being done by Python. You're not passing SQLObject
any string to interpret here.

So, if you pass in a string, we either need to

a) recreate what Python does there, or
b) have Python do it via eval()

If you're just talking about getting a specific attribute from a
single object, we can just do getattr(). But, once you start using
"."s, you're actually into a full-blown expression.

Kevin

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