Michael Bayer wrote:
>
> King Simon-NFHD78 wrote:
> >
> > to
> >
> >     master_id = sa.Column(sa.Integer,
> > sa.ForeignKey(Master.__table__.c.id))
> >
> > ...and now it seems to work! So is this a bug?
> 
> yes, that would be a bug.   There are some other scenarios 
> where this kind
> of thing occurs (lazy clause doesn't optimize) related to 
> inheritance but
> they are less clear cut as "bugs".
> 
> Another point though, if you upgrade to trunk /0.5.6, 
> many-to-one backrefs
> wont even fire off anymore if unloaded, when they are accessed in the
> backref context.
> 
> anyway my hunch is that the Column you get back from Master.id is a
> "proxy" to the real one, so we'd have to figure some way for 
> ForeignKey to
> navigate into the real column (dangerous, since it is 
> assuming) or get the
> "comparison" to honor proxy columns (more likely).   if you can file a
> ticket that would be very helpful otherwise im going to forget.
> 

Done. In case it helps, the proxy is an
sqlalchemy.sql.util.AnnotatedColumn. If you call '_deannotate' on it,
the resulting object compares equal with the original column.

Thanks again,

Simon

--~--~---------~--~----~------------~-------~--~----~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to