On Oct 13, 2008, at 2:50 PM, g00fy wrote:

>
> How this Proxy object is going to work exacly?
> Will that generate extra Sql or what?
> I assume that I should just change __getattr__() to desired and return
> Warehouse.key ? or warehouse_table.c.key?


the proxy, which actually should read:

class Proxy(object):
     def __getattr__(self, key):
         return getattr(Warehouse, "area_" + key)

works only at the class level and translates someting like  
Warehouse.area.office into Warehouse.area_office.   It's merely a  
Python trick to change how you access a particular class-level  
attribute.

SQLA 0.4 and above prefer class-level attributes to create expression  
predicates.   The ORM tutorials for 0.4 and 0.5 cover this in depth.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to