On 10/07/2016 05:49 PM, HP3 wrote:
Hello all,

Can a @hybrid_property be overriden by a subclass?


absolutely, hybrid_property is a python descriptor


Consider this modified example:
(from 
http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/hybrid.html#correlated-subquery-relationship-hybrid)

A subclass of User, UserWithBonuses, have its computed `balance` by
adding all balances of all SavingAccounts plus the amounts of all bonuses.



class UserWithBonuses(Base):
    __tablename__ = 'user_with_bonuses'

you'd want that to be UserWithBonuses(User).


--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to