Re: [Sqlalchemy-tickets] [sqlalchemy] #2872: AliasedClass.__getattr__() creates malformed Queryable
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-11-23 15:00:29
|
#2872: AliasedClass.__getattr__() creates malformed QueryableAttribute
---------------------------+-------------------------------
Reporter: elic | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.0
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
---------------------------+-------------------------------
Comment (by zzzeek):
> To explain the metaclass: it's being used to intercept the class-
setattr() call made by ClassManager.instrument_attribute(), and store the
InstrumentedAttribute internally.
yeah you can use ext.instrumentation for that, but if you only need to
detect it as an event and not actually change the end result of
instrument_attribute, you can just use a straight event:
http://docs.sqlalchemy.org/en/rel_0_9/orm/events.html#sqlalchemy.orm.events.InstrumentationEvents.attribute_instrument
(seems like the docstring there is missing or broken, but you get the
idea).
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2872#comment:5>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|