I'll post a test case later if needed, but this is more of a technical 
question so i don't think it will be needed.

When i use iterate_properties on a class with a hybrid_property, it's not 
shown in the list. I am trying to 'extract' fields from classes in order to 
automatically build forms from them. iterate_properties was useful for 
getting most info, but eventually i had to start using 'for k in 
dir(class)' to get access to association proxies on the classes. I would 
use getattr(cls, k) to get the object, but for hybrid properties this calls 
fget, and directly returns a BinaryExpression, rather than the property 
itself. The only way I can find to access the actual hybrid_property object 
is via vars(cls), and then, this doesn't contain hybrid properties defined 
on the bases which are being used by the class.

Is there a way built into sqlalchemy to get all hybrid_property objects for 
a class, both those declared on the active class and those declared on the 
base classes? I'm mainly interested in determining whether a setter has 
been provided on the property, to determine if it's readonly or not.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/sOnrMob9HIoJ.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to